xinyb
2024-09-13 3118f76b8168019c91106d4d38d2ce1a2a74c494
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.Map"%>
<%@page import="com.yc.factory.FactoryBean"%>
<%@page import="com.yc.service.personalized.PanelDataIfc"%>
<%@page import="com.yc.utils.SessionKey"%>
<%@page import="java.util.List"%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/style/commons.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/commons.css")%>">
<link rel="stylesheet" type="text/css" href="/style/icon.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/icon.css")%>">
<link rel="stylesheet" type="text/css" href="/style/default/easyui.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/default/easyui.css")%>"> 
<script type="text/javascript" src="/js/jquery-1.4.4.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/jquery-1.4.4.min.js")%>"></script>
<script type="text/javascript" src="/js/index/jquery.easyui.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/jquery.easyui.min.js")%>"></script>
<script type="text/javascript" src="/js/shujuLogin.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/shujuLogin.js")%>"></script>
</head>
<%
String userCode = (String)session.getAttribute(SessionKey.USERCODE);
    String pass = (String)session.getAttribute(SessionKey.USERCODE);
    String comp= (String) session.getAttribute(SessionKey.DATA_BASE_NAME);
    String tishi=request.getParameter("ti");
    String spass="";
    try{    
    PanelDataIfc panelDataIfc = (PanelDataIfc)FactoryBean.getBean("PanelDataImpl");
    List<Map<String,Object>> panels = null;     
        panels = panelDataIfc.getshujulogin(userCode);
        if(panels.size()<1){
            panelDataIfc.getShujuAdd(comp,userCode,pass);//保存初始数据            
        }else{
         spass=panels.get(0).get("spass").toString();
         if(!userCode.equals(spass)){
             spass="";
         }
        }
      }catch(Exception e){
          spass="";
          tishi="2";
    }
       
        %>
<script type="text/javascript">
function windowopen(){
    var appkey=document.getElementById("appkey").value;
    var appsecret=document.getElementById("appsecret").value;
    var tbtype=document.getElementById("tbtype").value;
 
    if(appsecret==""){
           alert('缺少参数APPSecret');
           return;
        }
    var urls="";
    if(tbtype==1){
         urls="http://container.open.taobao.com/container?appkey="+appkey+"&encode=utf-8";
        }
    if(tbtype==2){
         urls="http://container.api.tbsandbox.com/container?appkey="+appkey+"&encode=utf-8";
        }
        $.ajax({url:"/tesst.do?app=appkey",data:{'appkey' :appkey,'appsecret' :appsecret,'tbtype':tbtype},type:"POST",
            async:false,dataType:'text',success:function(da) {
              if(da==1){
                    window.close();
                    window.open(urls);                    
                  }
            }});
 
}
</script>
<body>
    <div class="easyui-layout" fit="true">
         <div region="north" border="false" style="padding-top:15px;padding-bottom:15px;text-align:center;background:#fff;">
              <span><font size="2" color="BBBOOO">APPKey和APPSecret是您在淘宝应用申请的证书钥匙和密钥</font></span>
         </div>
        <div region="center" border="true" style="text-align:center;padding-top:25px;background:#fff;border:1px solid #ccc;">
       
        <form id="loginForm" method="post"> 
        <table align="center" >
        <tr><td align="right">                    
              <font size="2">APPKey:</font>
                </td><td>
                <input type="text" id="appkey" name="appkey" value="" maxlength="30" style="width:200px; height:20px;"></input>
            </td>
            </tr>
            <tr><td></td><td></td></tr>
            <tr>               
            <td align="right">
               <font size="2">APPSecret:</font>
                </td>
                <td>
                <input type="text" id="appsecret" name="appsecret" value="" style="width:200px; height:20px;"></input>  
                                                            
 </td>
            </tr>
            <tr><td></td><td></td></tr>
             <tr>               
            <td align="right">
               <font size="2">应用环境:</font>
                </td>
                <td align="left">
               <select name="tbtype" id="tbtype" style="width:12s0px; height:30px;">
               <option value="1">正式应用环境</option><option value="2">沙箱测试环境</option>
               </select>
                                                            
 </td>
            </tr>
             <tr><td></td><td></td></tr>
             <tr><td></td><td></td></tr>
            <tr>          
                <td colspan="2" align="center">
                                    (注:”沙箱测试环境“需在中间表后面加“|2”)
                                                            
 </td>
            </tr>
             </table>
        </form>
        </div>
            <div region="south" border="false" style="text-align:center;padding:5px 0;overflow: hidden;">
                <a id="login" class="easyui-linkbutton" iconCls="icon-ok" onclick="windowopen()">确   定</a>
            </div>
    </div>
</body>
</html>