xinyb
2024-06-15 fdd73a906963f31abb59d81c10cc163eab47404a
提交 | 用户 | age
a6a76f 1 <%
F 2 //一个功能号专用一个秘密
3 %>
4 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
5 <%@page import="com.yc.factory.FactoryBean"%>
6 <%@page import="com.yc.service.approving.ApprovingPwdIfc"%>
7 <%@page import="com.yc.utils.SessionKey"%>
38b50d 8 <%@ page import="com.yc.service.approving.ApprovingEntity" %>
a6a76f 9 <%
F 10
11     String formid = (String)request.getAttribute("inputPwd_formid");
12     
13     if(formid==null)return;
38b50d 14
X 15     String userCode = (String)session.getAttribute(SessionKey.USERCODE);
16
a6a76f 17     ApprovingPwdIfc pwd = (ApprovingPwdIfc)FactoryBean.getBean("ApprovingPwdImpl");
38b50d 18
X 19     String isOpenFuncShowPwdEdit= (String) request.getAttribute("isOpenFuncShowPwdEdit");
20
21     Integer checkPwdType=isOpenFuncShowPwdEdit!=null?Integer.parseInt(isOpenFuncShowPwdEdit):4;
22
a6a76f 23     String queryString = (String)request.getAttribute("inputPwd_queryString");
F 24
25     String uri = (String)request.getAttribute("inputPwd_uri");
26     
27     String message = (String)request.getAttribute("inputPwd_msg");
38b50d 28
X 29     ApprovingEntity approvingEntity=pwd.getApprovingExists(formid,userCode,checkPwdType);
30
31     if(approvingEntity == null){
32         request.getRequestDispatcher("/general/inputPwdAdd.jsp").forward(request,response);
33         return;
34     }else{
35         request.getSession().setAttribute("onlyCode",approvingEntity.getOwnerUserCode());
36         request.getSession().setAttribute("onlyName",approvingEntity.getOwnerUserName());
37     }
38
a6a76f 39     if(queryString==null)queryString="";
F 40     if(uri==null)uri="";
41 %>
42 <html>
43 <head>
44 <base target="_self" />
13cd45 45 <%--<title>--%>
X 46 <%--需要输入密码才能继续--%>
47 <%--</title>--%>
a6a76f 48 <link rel="stylesheet" type="text/css" href="stylesheet.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"stylesheet.css")%>" title="Style">
bf4c38 49     <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>
a6a76f 50 <style type="text/css">
F 51     *{font-family:'Verdana','宋体';}
52     .in{border:1px solid #cccccc;height:22px;}
53     ul{list-style: none;font-size: 10pt;font-family:'Verdana','宋体';height:24px;line-height: 24px;vertical-align: middle;margin:auto;margin-top:45px; }
54 </style>
55
56 </head>
57 <body style="text-align: center;background-color: #F5F5F5">
58     
59     <div style="border:1px solid #cccccc;height:250px;width: 350px;margin:auto;margin-top:130px;">
60         <div style="font-size:14px;font-weight: bold;width:100%;height:30px;background-color: #cccccc;vertical-align: middle;line-height: 30px;">需要输入密码才能继续!</div>
61         <div>
bf4c38 62             <form action="">
a6a76f 63             <ul>
F 64                 <li style="float: left;width:75px;">请输入密码:</li>
65                 <li style="float: left;"><input class="in" type="password" id="password" name="pwd" value=""></input></li>
66             </ul>
67             <ul style="width:160px;">
bf4c38 68                 <li style="float: left;"><input type="button" id="submit" style="width:65px;height:24px;" value="确定"></input>&nbsp;</li>
a6a76f 69                 <li style="float: left;"><input type="button" style="width:65px;height:24px;" onclick="parent.closeTab();" value="关闭"></input>&nbsp;</li>
F 70             </ul>
96514d 71                 <ul style="margin: 0px;padding-top: 15px">
X 72                     <li style="float: left;color: blue;cursor: pointer" class="updatePwd">修改密码</li>
73                     <li style="float: right;padding-right: 40px;color: blue;cursor: pointer" class="forgetPwd">忘记密码</li>
74                 </ul>
a6a76f 75             <input type="hidden" name="queryString" value="<%=queryString %>"></input>
F 76             <input type="hidden" name="uri" value="<%=uri %>"></input>
77             <input type="hidden" name="formid" value="<%=formid %>"></input>
78             </form>
79         </div>
80     </div>
81 <%
82     if(message!=null&&!"".equals(message)){
83         out.write("<script type='text/javascript'>alert('"+message+"');</script>");
84     }
85 %>
bf4c38 86     <script>
X 87         function setSub(){
88             let pwd = $("#password").val();
89             if (pwd == null || pwd=="") {
90                 alert("请输入密码");
91                 return;
92             }
93             $.ajax({
38b50d 94                 url: "/inputPwdCheck.do",
bf4c38 95                 data: JSON.stringify({
X 96                     "formid": "<%=formid %>",
2d77d1 97                     "isOpenFuncShowPwdEdit":4,
bf4c38 98                     "password": pwd,
X 99                     "uri": "<%=uri %>",
100                     "queryString": "<%=queryString %>"
101                 }),
102                 type: "POST",
103                 async:false,
104                 dataType: "json",
105                 contentType: 'application/json',
106                 success: function (data) {
107                     if (data != null && data.code == 0) {
108                         let v = data.data;
109                         if (typeof v === 'string') {
110                             location.href = v;
111                         } else if (typeof v === 'boolean' && !v) {
112                             alert("密码错误");
113                         }
114                     } else {
115                         $("#password").val("");
116                         alert(data.data);
117                     }
118                 }
119             });
120         }
121         $(function () {
122             $("#password").focus();
123             $("#submit").on("click", function () {
124                 setSub();
125             })
126             $("#password").keydown(function(e){
127                 if(e.keyCode==13){
128                     setSub();
129                 }
130             });
96514d 131             $(".updatePwd").on("click",function () {
2d77d1 132                 location.href="/general/inputPwdUpdate.jsp?formid=<%=formid%>&queryString=<%=queryString%>&uri=<%=uri%>&isOpenFuncShowPwdEdit=4";
96514d 133             })
X 134             $(".forgetPwd").on("click",function () {
2d77d1 135                 location.href="/general/inputPwdForget.jsp?formid=<%=formid%>&queryString=<%=queryString%>&uri=<%=uri%>&isOpenFuncShowPwdEdit=4";
96514d 136             })
bf4c38 137         })
X 138     </script>
a6a76f 139 </body>
F 140 </html>