fstLogin.home.jsp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. <%@ page import="ss.WebC" %>
  2. <html>
  3. <head>
  4. <title>${sessionScope.projectUrlDesc}</title>
  5. <skin.ss file="/ss/dlg"/>
  6. <skin.ss file="/ss/menu"/>
  7. <js.ss file="/ss/appauthority.js"/>
  8. <js.ss file="/ss/qrcode/qrcode.js"/>
  9. <js.ss file="/ss/qrcode/jquery.qrcode.js"/>
  10. <style>
  11. /*.login-wrapper {
  12. width: 100vw;
  13. height: 100vh;
  14. position: fixed;
  15. left: 0px;
  16. top: 0px;
  17. background: url(/$@{sessionScope['XMMC']}/theme/EasyUses/image/bgpic.png) center center no-repeat;
  18. background-size: 100% 100%;
  19. }*/
  20. .login-wrapper-top {
  21. width: 667px !important;
  22. height: 267px !important;
  23. position: absolute;
  24. left: 50% !important;
  25. top: 50% !important;
  26. margin-left: -333.5px;
  27. margin-top: -133.5px;
  28. background-size: 100% 100%;
  29. }
  30. .login-div{
  31. width: 100%;
  32. height: 100%;
  33. position: relative;
  34. }
  35. .logo{
  36. float: left;
  37. margin-top: 41px;
  38. margin-left: 52px;
  39. width: 183px;
  40. height: 183px;
  41. }
  42. .form-wrapper {
  43. display: inline-block;
  44. float: right;
  45. width: 383px;
  46. height: 267px;
  47. position: relative;
  48. box-sizing: border-box;
  49. padding-top: 27px;
  50. padding-left: 44px;
  51. }
  52. .form-wrapper form{
  53. width: 100%;
  54. height: 100%;
  55. position: relative;
  56. }
  57. .form-wrapper .form-wrapper-row{
  58. display: block;
  59. width: 278px;
  60. position: relative;
  61. overflow: hidden;
  62. margin-bottom: 16px;
  63. }
  64. .login-div input[type="text"],.login-div input[type="password"]{
  65. width: 240px;
  66. height: 28px;
  67. box-sizing: border-box;
  68. margin-right: 0px;
  69. padding-left: 12px;
  70. outline: none;
  71. }
  72. .login-div .form-icon{
  73. display: inline-block;
  74. width: 25px;
  75. height: 28px;
  76. float: left;
  77. margin-right: 13px;
  78. }
  79. .ksmm{
  80. width: 17px;
  81. height: 11px;
  82. display: inline-block;
  83. position: absolute;
  84. right: 8px;
  85. top: 8px;
  86. }
  87. .header_yzmimg{
  88. position: absolute;
  89. right: 1px;
  90. top: 1px;
  91. width: 120px;
  92. height: 26px;
  93. }
  94. .login-div .bottom-button{
  95. margin: 0px;
  96. }
  97. .zdspDiv{
  98. position: absolute;
  99. }
  100. .ic{z-index: 2}
  101. select{
  102. appearance:none;
  103. -moz-appearance:none;
  104. -webkit-appearance:none;
  105. }
  106. .goon {
  107. border: 1px solid rgba(0,0,0,0);
  108. width: 240px;
  109. height: 28px;
  110. box-sizing: border-box;
  111. margin-right: 0px;
  112. padding-left: 12px;
  113. outline: none;
  114. font-size: 14px;
  115. color: #999;
  116. border-radius: 2px;
  117. appearance:none;
  118. background: rgba(0,0,0,0);
  119. }
  120. /*.sp::after {
  121. content: "";
  122. width: 24px;
  123. height: 8px;
  124. background: url(/zzfb_/theme/EasyUses/image/objectPicker_handle.png) center center no-repeat;
  125. pointer-events: none;
  126. position: absolute;
  127. right: 0px;
  128. top: 33%;
  129. }*/
  130. .sp {
  131. position: relative;
  132. padding-left: 33px;
  133. bottom: 21px;
  134. width: 240px;
  135. }
  136. /* select {
  137. appearance: none;
  138. -webkit-appearance: none;
  139. -moz-appearance: none;
  140. }*/
  141. .bottom-container {
  142. width: 1000px;
  143. height: 2px;
  144. position: absolute;
  145. left: 50% !important;
  146. top: 50% !important;
  147. margin-left: -500px;
  148. margin-top: 155px;
  149. }
  150. /*.bottom-one {
  151. background: linear-gradient(to right, rgba(108, 157, 192, 0), rgba(108, 157, 192, 1));
  152. width: 500px;
  153. height: 2px;
  154. display: inline-block;
  155. }
  156. .bottom-two {
  157. background: linear-gradient(to left, rgba(108, 157, 192, 0), rgba(108, 157, 192, 1));
  158. width: 500px;
  159. height: 2px;
  160. display: inline-block;
  161. float: right;
  162. }*/
  163. /*.daoyin {
  164. width: 668px;
  165. height: 65px;
  166. background: linear-gradient(180deg, rgb(145, 165, 195, 0.15), rgba(145, 165, 195, 0));
  167. border-radius: 3px;
  168. position: absolute;
  169. left: 50% !important;
  170. top: 50% !important;
  171. margin-left: -333px;
  172. margin-top: 180px;
  173. }*/
  174. .resetpwddiv,
  175. .phonelogindiv {
  176. display: inline-block;
  177. position: relative;
  178. }
  179. /*.login-phonelogin {
  180. width: 66px;
  181. background-image: url("/zzfb_/theme/EasyUses/image/mdenglu.png");
  182. padding-right: 5px;
  183. margin-left: 9px;
  184. }
  185. .login-phonelogin:hover {
  186. color: #fff !important;
  187. background-image: url("/zzfb_/theme/EasyUses/image/mdenglu-hover.png");
  188. }*/
  189. /*.login-phonelogin:active {
  190. color: #fff !important;
  191. background-image: url("/zzfb_/theme/EasyUses/image/mdenglu_active.png");
  192. }*/
  193. .login{
  194. position: relative;
  195. width: 80px;
  196. text-align: center !important;
  197. }
  198. .phoneloginmask,.resetpwdmask{
  199. width: 100%;
  200. text-align: center;
  201. line-height: 33px;
  202. outline: medium;
  203. /* color: rgb(72, 99, 164); */
  204. font-size: 16px;
  205. /* background-color: #ccc; */
  206. border-radius: 5px;
  207. position: absolute;
  208. top: 0;
  209. /* left: 28px; */
  210. }
  211. /*.resetpwdmask {
  212. width: 63%;
  213. text-align: center;
  214. line-height: 30px;
  215. outline: medium;
  216. color: rgb(72, 99, 164);
  217. font-size: 16px;
  218. background-color: #ccc;
  219. border-radius: 5px;
  220. position: absolute;
  221. top: 0;
  222. left: 35px;
  223. }*/
  224. /*登录次数*/
  225. .login-sca {
  226. height: 12px;
  227. display: inline-block;
  228. /* margin-top: 11px;
  229. margin-left: 1px;
  230. position: relative;
  231. left: 19px;*/
  232. }
  233. .link_gs a {
  234. position: fixed;
  235. right: 40px;
  236. bottom: 30px;
  237. }
  238. .link_bbh{
  239. position: fixed;
  240. right: 40px;
  241. bottom: 60px;
  242. }
  243. #msgDiv{
  244. /* margin-top: 7px !important;*/
  245. }
  246. #msgDiv::before {
  247. position: absolute;
  248. content: '';
  249. top: -12px;
  250. right: 13px;
  251. z-index: 9999;
  252. }
  253. .Start-banben {
  254. color: #fff;
  255. font-size: 18px;
  256. text-align:right;
  257. position: fixed;
  258. bottom:7%;
  259. right:3%;
  260. width: 100%;
  261. font-family: "SIL Hei";
  262. }
  263. .Start-copyright {
  264. color: #fff;
  265. font-size: 18px;
  266. text-align:right;
  267. position: fixed;
  268. right:3%;
  269. bottom:3%;
  270. width: 100%;
  271. font-family: "黑体";
  272. }
  273. #trianglebottomright {
  274. width: 40px;
  275. height: 40px;
  276. }
  277. .bottomright{
  278. position: absolute;
  279. right: 0;
  280. background-color:#FFF;
  281. border-radius: 5px;
  282. bottom: 0;
  283. padding: 8px;
  284. }
  285. .bottomright-small{
  286. position: absolute;
  287. right: 8px;
  288. bottom: 8px;
  289. }
  290. .qrcode-text{
  291. font-family:"SIL Hei";
  292. font-size: 14px;
  293. line-height: 24px;
  294. }
  295. </style>
  296. </head>
  297. <body bgcolor="ffffff" background="" style="margin:0px;padding:0px;">
  298. <table style="align:center; width:1024px; height:1px;">
  299. <tr><td valign="top">
  300. <div id="m22033103" style="position:absolute; margin-left:96px;top:379px; width:470px;height:230px; z-index:0;">
  301. <script>
  302. function showDyd(yhm){
  303. yhm=yhm||$("input[name='yhm']").val();
  304. var sbbs = $("input[name='sbbs']").val();
  305. if(yhm==""||sbbs==""){
  306. return;
  307. }
  308. $.ajax({
  309. type:"post",
  310. url:"<serv.ss name='ss.chkDevState'/>",
  311. data:{zh:yhm,bs:sbbs},
  312. dataType:"json",
  313. success:function(result){
  314. if(result.status){
  315. //显示扫一扫按钮,隐藏扫一扫按钮,显示鼠标移过,显示扫一扫
  316. $(".dyd").css("display","inline-block");
  317. $(".bottomright-small").css("display","block");
  318. $(".loginScanCodeBox").css("display","none");
  319. }else{
  320. $(".dyd").css("display","none");
  321. $(".bottomright-small").css("display","none");
  322. $(".loginScanCodeBox").css("display","inline-block");
  323. }
  324. }
  325. });
  326. }
  327. </script>
  328. <div class="login-pageBackground">
  329. <div class="login-wrapper-top">
  330. <div id="login-denglu" class="login-div" style="position: relative;">
  331. <div class="logo" style="background: url(${sessionScope.XMMC}/image/logo/largeLogo.png) center center no-repeat;">
  332. </div>
  333. <div class="form-wrapper">
  334. <form name="Form1" action="<serv.ss name='ss.login'/>" method="post"> <%-- 这里必须是 ss.login,ss.login 会调用应用的 login。Lin --%>
  335. <input name="sbmc" type="hidden" />
  336. <equal.ss val="${empty LOGIN_PAGE_YHSB}" val2="false">
  337. <input name="sbbs" type="hidden" value="${LOGIN_PAGE_YHSB.bs}" />
  338. <input name="userId" type="hidden" value="${LOGIN_PAGE_YHSB.yhid}" />
  339. </equal.ss>
  340. <equal.ss val="${empty LOGIN_PAGE_YHSB}" val2="true">
  341. <input name="sbbs" type="hidden" value="${sbbs}" />
  342. </equal.ss>
  343. <input name="ysbbs" type="hidden" />
  344. <input type="hidden" name="applp" />
  345. <input type="hidden" name="homepage" value="1" />
  346. <div class="form-wrapper-row">
  347. <span class="form-icon icon-user"></span><input name="yhm" autocomplete="off" value="${yhm}" type="text" onblur="showDyd()" class="login-header_yzm login-input header_yzm_pas" size="6" placeholder="用户名" onkeyup="handleYhmChange(event)" />
  348. </div>
  349. <div class="form-wrapper-row">
  350. <span class="form-icon icon-password"></span><input placeholder="密码" value="${mm}" name="mm" readonly onfocus="this.removeAttribute('readonly');" autocomplete="off" class="login-header_password login-input header_yzm_pas" type="password" />
  351. <span class="ksmm icon-eye"></span>
  352. </div>
  353. <div class="form-wrapper-row">
  354. <span class="form-icon icon-captcha"></span>
  355. <input name="yzm" type="text" size="6" class="login-yzm_input login-input" placeholder="验证码" />
  356. <img align="middle" vspace="2" id="codeimg" title="看不清楚可单击刷新" class="header_yzmimg" src="/captcha?<%="random="+new java.util.Date().getTime() %>" onclick="imgonchange()">
  357. </div>
  358. <div class="form-wrapper-row">
  359. <span class="form-icon icon-timer"></span>
  360. <span class="icon-down ic" style="z-index: 1;"></span>
  361. <input class="login-div zdspDiv" name="zdspName" type="text" />
  362. <select name="zdsp" class="goon login-div" style="float: left;" id="zdsp">
  363. <option value="5">5分钟后锁定</option>
  364. <option value="10">10分钟后锁定</option>
  365. <option value="15" selected="selected">15分钟后锁定</option>
  366. <option value="30">30分钟后锁定</option>
  367. </select>
  368. </div>
  369. <div class="form-wrapper-row dyd" style="width: 282px;text-align: center;margin-bottom: 2px;display: flex;display:none;white-space: nowrap;">
  370. <input type="submit" id="dlbtn" class="bottom-button login" value="登录" />
  371. <div class="phonelogindiv">
  372. <input type="button" value="登录" class="bottom-button icon-mobile" style="border: none;height: 33px;border-radius: 4px;margin:0px !important;"
  373. onclick="appAuthority(event); return false;" />
  374. <div class="phoneloginmask icon-countdownButton" style="display:none;"></div>
  375. </div>
  376. <div class="phonelogindiv">
  377. <input type="button" style="margin-right:4px;" value="重置密码" class="bottom-button icon-mobile login-resetpwd" onclick="resetPassword(event);">
  378. <div class="resetpwdmask icon-countdownButton" style="display: none;"> 1s</div>
  379. </div>
  380. </div>
  381. <div class="loginScanCodeBox" style="display: inline-block;margin-left: 39px;position: relative;">
  382. <input type="submit" id="dlbtn" class="bottom-button" style="position: relative;margin:0px !important;padding:0px 35px" value="登录" />
  383. <input type="button" value="扫一扫登录" class="loginScanCode bottom-button icon-qrcode" style="padding:0 12px;margin-left: 6px;border: none;height: 33px;text-align: right;border-radius: 4px;margin:0px !important;" />
  384. <div class="login-resetpwdmask icon-countdownButton" style="width: 100%;text-align: center;line-height: 33px;outline: medium;border-radius: 5px;position: absolute;top: 0px;"></div>
  385. </div>
  386. <div class="form-wrapper-row" style="width: 100%;">
  387. <div class="login-sca" style="float: left;padding-right: 11px;margin-top:15px;">
  388. </div>
  389. </div>
  390. </form>
  391. </div>
  392. <div class="bottomright" id="qrcodeBox" style="display:none;z-index: 9999;">
  393. <div style="height: 30px;">
  394. <span class="qrcode-text">APP扫一扫登录</span>
  395. <div id="closeQrcode" class="icon-close" style="height: 15px;width: 15px;position: absolute;right: 8px;top: 13px;;"></div>
  396. </div>
  397. <div id="qrcode" style="width:126px;height:126px;z-index: 9999 !important">
  398. </div>
  399. </div>
  400. <div class="bottomright-small" id="trianglebottomright" style="background: url(${sessionScope.XMMC}/image/logo/qrcode-open.png) center center no-repeat;display:none;"></div>
  401. </div>
  402. </div>
  403. <div class="bottom-container">
  404. <span class="login-pageLeftLine"></span>
  405. <span class="login-pageRightLine"></span>
  406. </div>
  407. <div class="login-pageShadow">
  408. </div>
  409. <div class="Start-banben" id="bbh">
  410. V&nbsp;1.0
  411. </div>
  412. <div class="Start-copyright">
  413. 技术服务:广东非繁科技有限公司
  414. </div>
  415. </div>
  416. <script type="text/javascript">
  417. <%--最大登录失败次数--%>
  418. <%
  419. out.println("var loginFailureMaximum="+base.SsC.LOGIN_maxNum+";");
  420. %>
  421. loginFailureMaximum=parseInt(loginFailureMaximum);
  422. function showMsg(msg,positionEle){
  423. if($("#msgDiv").length==0)
  424. $("body").append('<span id="msgDiv" class="warningFlashMsg-div warningFlashMsg-upArrow" style="position: absolute;">肥肥6666</span>');
  425. if(!positionEle)
  426. positionEle=document.querySelector(".login-sca");
  427. $("#msgDiv").html(msg);
  428. var bounding=positionEle.getBoundingClientRect();
  429. var msgbouding=document.querySelector("#msgDiv").getBoundingClientRect();
  430. $("#msgDiv").css({left:bounding.left-msgbouding.width+30,top:bounding.top+msgbouding.height-5});
  431. }
  432. window.addEventListener("load",function(){
  433. (function(){
  434. var html = "";
  435. for(var ii=0;ii<loginFailureMaximum;ii++){
  436. html="<span class='login-sc login-used' style='width: 8px;height: 8px;display: block;border-radius: 50%;float: left;margin-right: 5px;' time=\""+(ii+1)+"\"></span>"+html;
  437. }
  438. $(".login-sca").append(html);
  439. var yhid = '${yhid}';
  440. var failNum='${dlcwcs}'
  441. var msg='${msg}'
  442. /* 再改。Lin
  443. var updatePwdUrl='/wd/page/updatePwd.jsp?yhid=${yhid}&yhm=${yhm}';
  444. var forceUpdatePwdUrl='/wd/page/forceUpdatePwd.jsp?yhid=${yhid}&yhm=${yhm}&pwdStrengthMsg='+encodeURIComponent('${pwdStrengthMsg}');
  445. */
  446. var updatePwdUrl = '<%=WebC.PPATH_editPwd%>?yhid=${yhid}&yhm=${yhm}';
  447. var forceUpdatePwdUrl = '<%=WebC.PPATH_forceEditPwd%>?yhid=${yhid}&yhm=${yhm}&pwdStrengthMsg='+encodeURIComponent('${pwdStrengthMsg}');
  448. if(!yhid&&failNum){
  449. failNum=loginFailureMaximum-parseInt(failNum);
  450. if(failNum>0){
  451. for(var i=0;i<failNum;i++){
  452. $(".login-sc[time="+(i+1)+"]").addClass("login-unused");
  453. }
  454. showMsg(msg,$(".login-sc[time="+failNum+"]")[0]);
  455. return
  456. }
  457. }else{
  458. $(".login-sca").css("visibility","hidden");
  459. }
  460. if (yhid) {
  461. var pwdEditUrl = ('1' == '${forceUpdatePwd}')
  462. ? forceUpdatePwdUrl
  463. : updatePwdUrl;
  464. try {
  465. wd.display.showComponent({
  466. show:["wdDialog"], hide:[], url:pwdEditUrl, title:"修改密码",
  467. width:500, height:500, wdDialogId:44019561, form:""
  468. });
  469. } catch (e) {
  470. console.log(e);
  471. window.location.href = pwdEditUrl;
  472. }
  473. return;
  474. } else if(msg) {
  475. showMsg(msg,$(".login-sc[time="+loginFailureMaximum+"]")[0]);
  476. return;
  477. }else{
  478. return ;
  479. }
  480. })()
  481. },false)
  482. </script>
  483. <script type="text/javascript">
  484. //解决登录页面提示框上的小三角的显示
  485. function showMsg(msg,positionEle){
  486. if($("#msgDiv").length==0)
  487. $("body").append('<span id="msgDiv" class="warningFlashMsg-div warningFlashMsg-up" style="position: absolute;">肥肥6666</span>');
  488. if(!positionEle)
  489. positionEle=document.querySelector(".login-sca");
  490. $("#msgDiv").html(msg);
  491. var bounding=positionEle.getBoundingClientRect();
  492. var msgbouding=document.querySelector("#msgDiv").getBoundingClientRect();
  493. $("#msgDiv").css({left:bounding.left-msgbouding.width+30,top:bounding.top+msgbouding.height-3});
  494. }
  495. </script>
  496. <script>
  497. $(function () {
  498. try{
  499. if(beacon && beacon.getComputerName) {
  500. $("input[name=sbmc]").val(beacon.getComputerName());
  501. }
  502. if(beacon&&beacon.getMacAddress){
  503. $("input[name=sbbs]").val(beacon.getMacAddress());
  504. }
  505. if(beacon&&beacon.getTrueMacAddress){
  506. $("input[name=ysbbs]").val(beacon.getTrueMacAddress());
  507. }
  508. }catch(err){
  509. $("input[name=sbmc]").remove();
  510. $("input[name=sbbs]").remove();
  511. $("input[name=ysbbs]").remove();
  512. }
  513. })
  514. function utf16to8(str) {
  515. var out, i, len, c;
  516. out = "";
  517. len = str.length;
  518. for(i = 0; i < len; i++) {
  519. c = str.charCodeAt(i);
  520. if ((c >= 0x0001) && (c <= 0x007F)) {
  521. out += str.charAt(i);
  522. } else if (c > 0x07FF) {
  523. out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
  524. out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
  525. out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
  526. } else {
  527. out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
  528. out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
  529. }
  530. }
  531. return out;
  532. }
  533. function qrcode() {
  534. $.ajax({
  535. type: "post",
  536. url: "<serv.ss name='wrQrcodeLoginKey'/>", // ='getPrivateKey'。Lin
  537. async: true,
  538. dataType:"json",
  539. success: function(data) {
  540. var sbbs = $("input[name='sbbs']").val();
  541. /* 再改,直接拼 ss:xx,yy:"zz",... -- 不用 JSON.stringify(,会生成 "ss":2...。Lin
  542. var json = {
  543. ss:1, // 增加,1 = login -- ss:xx,yy:"zz",...。Lin
  544. k: data.k, // .privateKey,。ATR_keyByQrcodeLoginName = "k"。Lin
  545. d:sbbs
  546. };
  547. qrCodeGenerate("#qrcode", "@hdL"+JSON.stringify(json)+"@", 126, 126, "canvas");
  548. */ qrCodeGenerate("#qrcode", "ss:1,k:\""+ data.k +"\",d:\""+ sbbs +"\"", 126, 126, "canvas");
  549. }
  550. });
  551. }
  552. function qrCodeGenerate(id,text,width,height,render){
  553. var option = {
  554. render: "canvas",
  555. text: text,
  556. width: width||"200",
  557. height: height||"200",
  558. correctLevel:QRErrorCorrectLevel.M
  559. };
  560. $(id).find(".qrcode").remove();
  561. $(id).append("<div class='qrcode'></div>");
  562. $(id).find(".qrcode").qrcode(option);
  563. }
  564. var stop=2*60*1000;//两分钟后停止
  565. var begin;
  566. var end;
  567. function getLoginStatus(){
  568. end=new Date().getTime();
  569. if((end-begin)>stop){
  570. stopInterval();
  571. return;
  572. }
  573. var sbbs = $("input[name='sbbs']").val();
  574. var ysbbs = $("input[name='ysbbs']").val();
  575. var sbmc = $("input[name='sbmc']").val();
  576. $.ajax({
  577. type: "post",
  578. url: "<serv.ss name='ifWrQrcodeLoginParmBySess'/>", // :'resetCookie'。Lin
  579. async: true,
  580. dataType:"json",
  581. data: { sbbs: sbbs, sbmc: sbmc,ysbbs:ysbbs },
  582. success: function(data) {
  583. if(data.code==200){
  584. stopInterval();
  585. //window.location.href="/$@{sessionScope['XMMC']}/page/home.jsp"
  586. $("input[name='mm']").val("");
  587. $("form[name='Form1']").submit();
  588. }
  589. if(data.code==1){
  590. stopInterval();
  591. /* 再改,去掉 result.ss.jsp,共用 errMsg.ss.jsp -- 共用 WebC.PPATH_errMsg。Lin
  592. var url = "/page/result.jsp?msg=此设备已挂失,无法登录"; // = "/wd/page/rs.jsp?。Lin
  593. */ var url = "<%=WebC.PPATH_errMsg%>?msg=此设备已挂失,无法登录";
  594. var title = "提示";
  595. wd.display.showComponent({
  596. show: ["wdDialog"],
  597. hide: [],
  598. url: url,
  599. title: title,
  600. width: 500,
  601. high: 300,
  602. form: ""
  603. })
  604. }
  605. }
  606. });
  607. }
  608. var getLoginInterval;
  609. function startInterval(){
  610. qrcode();
  611. $("#qrcodeBox").css("display","block");
  612. $("#trianglebottomright").css("display","none");
  613. begin=new Date().getTime();
  614. if (!getLoginInterval) {
  615. getLoginInterval = setInterval(getLoginStatus, 1000);
  616. }
  617. }
  618. function stopInterval(){
  619. $("#qrcodeBox").css("display","none");
  620. //扫一扫按钮隐藏,鼠标一移过打开扫一扫显示
  621. if($(".loginScanCodeBox").css("display")=='none'){
  622. $("#trianglebottomright").css("display","block");
  623. }else{
  624. $("#trianglebottomright").css("display","none");
  625. }
  626. clearInterval(getLoginInterval);
  627. getLoginInterval=null;
  628. }
  629. $("#trianglebottomright").mouseover(startInterval);
  630. $(".icon-qrcode").click(startInterval);
  631. $("#closeQrcode").click(stopInterval)
  632. </script>
  633. <script type="text/javascript">
  634. var passwordeye = $('.ksmm');
  635. var showPwd = $(".login-header_password");
  636. passwordeye.on('click', function() {
  637. if(showPwd.prop('type') == 'text') {
  638. showPwd.prop('type', 'password');
  639. } else {
  640. showPwd.prop('type', 'text');
  641. };
  642. });
  643. function imgonchange (){
  644. var myimg = document.getElementById("codeimg");
  645. now = new Date();
  646. myimg.src = "/captcha?code=" + now.getTime();
  647. }
  648. function appAuthority(event) {
  649. var srcElement = event.srcElement;
  650. srcElement.disabled = true;
  651. document.querySelector('.login-resetpwd').disabled = true;
  652. var time = document.querySelector('.phoneloginmask');
  653. var count = 60; //60s内不能重复触发
  654. time.innerText = ' ' + count + 's';
  655. document.querySelector('.phoneloginmask').style.display = 'block';
  656. var _oauth = wd.c.acquireAppAuthority({
  657. yhm: document.querySelector('input[name=yhm]').value,
  658. callback: function(res, publicKey) {
  659. console.log("code" + res.code);
  660. if(res.code == 0 && res.status == 2) {
  661. document.querySelector('input[name=applp]').value = publicKey;
  662. document.querySelector('form').submit();
  663. } else if(res.code == 0 && res.status == 1) {
  664. /* 再改,去掉 result.ss.jsp,共用 errMsg.ss.jsp -- 共用 WebC.PPATH_errMsg。Lin
  665. var url = "/page/result.jsp?msg=移动端拒绝登录"; // = "/wd/page/rs.jsp?。Lin
  666. */ var url = "<%=WebC.PPATH_errMsg%>?msg=移动端拒绝登录";
  667. var title = "提示";
  668. wd.display.showComponent({
  669. show: ["wdDialog"],
  670. hide: [],
  671. url: url,
  672. title: title,
  673. width: 500,
  674. high: 300,
  675. wdDialogId: 44019561,
  676. form: ""
  677. })
  678. count = 0;
  679. } else {
  680. //component 63
  681. /* 再改,去掉 result.ss.jsp,共用 errMsg.ss.jsp -- 共用 WebC.PPATH_errMsg。Lin
  682. var url = "/page/result.jsp?msg="+ res.msg; // = "/wd/page/rs.jsp?。Lin
  683. */ var url = "<%=WebC.PPATH_errMsg%>?msg="+ res.msg;
  684. var title = "提示";
  685. wd.display.showComponent({
  686. show: ["wdDialog"],
  687. hide: [],
  688. url: url,
  689. title: title,
  690. width: 500,
  691. high: 300,
  692. form: ""
  693. })
  694. count = 0;
  695. }
  696. },
  697. title: '登录PC授权',
  698. content: null,
  699. });
  700. srcElement.waiting = true; //是否等待中
  701. var _h = setInterval(function() {
  702. if(--count <= 0) {
  703. clearInterval(_h);
  704. clearInterval(_oauth);
  705. srcElement.disabled = false;
  706. srcElement.waiting = true;
  707. time.innerText = '';
  708. document.querySelector('.login-resetpwd').disabled = false;
  709. document.querySelector('.phoneloginmask').style.display = 'none';
  710. //document.querySelector('.login-resetpwd').style.display = 'none';
  711. } else {
  712. time.innerText = ' ' + count + 's';
  713. }
  714. }, 1000)
  715. }
  716. function resetPassword(event) {
  717. var srcElement = event.srcElement;
  718. srcElement.disabled = true;
  719. document.querySelector('.login-resetpwd').disabled = true;
  720. var time = document.querySelector('.resetpwdmask');
  721. var count = 60; //60s内不能重复触发
  722. time.innerText = ' ' + count + 's';
  723. document.querySelector('.resetpwdmask').style.display = 'block';
  724. var _oauth = wd.c.acquireAppAuthority({
  725. yhm: document.querySelector('input[name=yhm]').value,
  726. callback: function(res, publicKey) {
  727. if(res.code == 0) {
  728. $.ajax({
  729. url: '/service?ssServ=app_xgmm',
  730. method: 'post',
  731. data: {
  732. applp: publicKey
  733. },
  734. success: function(data) {
  735. data = JSON.parse(data);
  736. var result = data.result;
  737. if(result) {
  738. /* 再改,去掉 result.ss.jsp,改用 relogin.ss.jsp -- WebC.PPATH_relogin。Lin
  739. var url = "/page/result.jsp?msg=重置成功"; // = "/wd/page/rs.jsp?。Lin
  740. */ var url = "<%=WebC.PPATH_relogin%>?msg=重置成功,请重新登录";
  741. var title = "提示";
  742. wd.display.showComponent({
  743. show: ["wdDialog"],
  744. hide: [],
  745. url: url,
  746. title: title,
  747. width: 500,
  748. high: 300,
  749. form: ""
  750. });
  751. count = 0;
  752. } else {
  753. /* 再改,去掉 result.ss.jsp,共用 errMsg.ss.jsp -- 共用 WebC.PPATH_errMsg。Lin
  754. var url = "/page/result.jsp?msg="+ data.msg; // = "/wd/page/rs.jsp?。Lin
  755. */ var url = "<%=WebC.PPATH_errMsg%>?msg="+ data.msg;
  756. var title = "提示";
  757. wd.display.showComponent({
  758. show: ["wdDialog"],
  759. hide: [],
  760. url: url,
  761. title: title,
  762. width: 500,
  763. high: 300,
  764. form: ""
  765. });
  766. count = 0;
  767. }
  768. }
  769. });
  770. } else {
  771. /* 再改,去掉 result.ss.jsp,共用 errMsg.ss.jsp -- 共用 WebC.PPATH_errMsg。Lin
  772. var url = "/page/result.jsp?msg="+ res.msg; // = "/wd/page/rs.jsp?。Lin
  773. */ var url = "<%=WebC.PPATH_errMsg%>?msg="+ res.msg;
  774. var title = "提示";
  775. wd.display.showComponent({
  776. show: ["wdDialog"],
  777. hide: [],
  778. url: url,
  779. title: title,
  780. width: 500,
  781. high: 300,
  782. form: ""
  783. });
  784. count = 0;
  785. }
  786. },
  787. title: '重置密码授权',
  788. content: null,
  789. });
  790. srcElement.waiting = true; //是否等待中
  791. var _h = setInterval(function() {
  792. if(--count <= 0) {
  793. clearInterval(_h);
  794. clearInterval(_oauth);
  795. time.innerText = '';
  796. srcElement.disabled = false;
  797. srcElement.waiting = true;
  798. document.querySelector('.login-resetpwd').disabled = false;
  799. document.querySelector('.resetpwdmask').style.display = 'none';
  800. } else {
  801. time.innerText = ' ' + count + 's';
  802. }
  803. }, 1000);
  804. }
  805. </script>
  806. <script type="text/javascript">
  807. function get_cookie(Name) {
  808. var search = Name + "=" //查询检索的值
  809. var returnvalue = ""; //返回值
  810. if(document.cookie.length > 0) {
  811. sd = document.cookie.indexOf(search);
  812. if(sd != -1) {
  813. sd += search.length;
  814. end = document.cookie.indexOf(";", sd);
  815. if(end == -1)
  816. end = document.cookie.length;
  817. //unescape() 函数可对通过 escape() 编码的字符串进行解码。
  818. returnvalue = unescape(document.cookie.substring(sd, end))
  819. }
  820. }
  821. return returnvalue;
  822. }
  823. $(function() {
  824. var initYhm="${yhm}";
  825. showDyd(initYhm);
  826. //记住上次自动锁屏时间
  827. function storagezdsp (v) {
  828. localStorage.setItem("lockTime",v);
  829. }
  830. var lastzdsp=localStorage.getItem("lockTime")||$("#zdsp").val();
  831. $("#zdsp").val(lastzdsp);
  832. storagezdsp(lastzdsp);
  833. $("#zdsp").on("change",function () {
  834. // 将下拉框的值放进sessionStorage里
  835. storagezdsp($(this).val())
  836. })
  837. });
  838. </script>
  839. <script>
  840. $.ajax({
  841. type:"get",
  842. url:"<serv.ss name='ss.rdVer'/>",
  843. dataType:"text",
  844. success:function(res){
  845. $("#bbh").html(res.substring(1,res.length-1));
  846. }
  847. });
  848. </script>
  849. </div>
  850. </td>
  851. </tr>
  852. </table>
  853. </body>
  854. </html>