1001110031_run.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <%@ taglib uri="/WEB-INF/SpaceCoreApp.tld" prefix="app"%>
  4. <% pageContext.setAttribute(space.core.apps.common.ConstVars.MODULE_DM_KEY, "sys"); %>
  5. <!DOCTYPE html >
  6. <html>
  7. <head> <!-- HEAD -->
  8. <link rel="stylesheet" type="text/css" href="/css/reset.css">
  9. <link rel="stylesheet" type="text/css" href="/apps/space/plug-in/element-ui@2.13.0/index.css">
  10. <link rel="stylesheet" type="text/css" href="/apps/space/plug-in/layui/dist/css/layui.css">
  11. <link rel="stylesheet" type="text/css" href="/apps/space/css/SpaceIcon/iconfont.css">
  12. <link rel="stylesheet" type="text/css" href="/css/components.css">
  13. <link rel="stylesheet" href="/css/ckeditor.css">
  14. <script>var space = { vars: {} };</script>
  15. <script src="/js/jquery1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
  16. <script src="/apps/space/plug-in/element-resize-detector/element-resize-detector.min.js"></script>
  17. <script src="/apps/space/plug-in/vue/vue.min.js" type="text/javascript" charset="utf-8"></script>
  18. <script src="/apps/space/plug-in/element-ui@2.13.0/index.js" type="text/javascript" charset="utf-8"></script>
  19. <script src="/js/space.vue.pc.subassembly.js?v=20261111-image-center-source-v3"></script>
  20. <script src="/apps/space/plug-in/layui/dist/layui.all.js" type="text/javascript" charset="utf-8"></script>
  21. <script src="/js/space.recycle.js" type="text/javascript" charset="utf-8"></script>
  22. <script src="/js/space.display.js" type="text/javascript" charset="utf-8"></script>
  23. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  24. <meta name="renderer" content="webkit">
  25. <link rel="icon" type="image/png" sizes="16x16" href="${curWebSiteObj.seoIcon}">
  26. <title>登录 - ${curWebSiteObj.seoTitle}</title>
  27. <link rel="stylesheet" type="text/css" href="/css/login.css">
  28. <link rel="stylesheet" type="text/css" href="/css/animate.css">
  29. <style type="text/css">
  30. .login-content {
  31. height: 100%;
  32. width: 100%;
  33. background: url(/imgs/universe.jpg) right bottom;
  34. background-size: cover;
  35. }
  36. :-webkit-autofill {
  37. -webkit-text-fill-color: #000 !important;
  38. transition: background-color 5000s ease-in-out 0s;
  39. }
  40. #qrcode {
  41. width: 140px;
  42. height: 140px;
  43. margin: 50px auto 40px;
  44. }
  45. #qrcode canvas {
  46. width: 100%;
  47. height: 100%;
  48. }
  49. .login-states {
  50. position: absolute;
  51. top: 0;
  52. left: 0%;
  53. width: 100%;
  54. height: 100%;
  55. background-color: rgba(255, 255, 255, .8);
  56. text-align: center;
  57. color: #000;
  58. font-size: 18px;
  59. display: none;
  60. }
  61. .login-states i {
  62. color: #409eff;
  63. font-size: 50px;
  64. margin: 25px 0 5px;
  65. display: inline-block;
  66. }
  67. .refresh {
  68. width: 110px;
  69. height: 34px;
  70. line-height: 34px;
  71. text-align: center;
  72. margin: 0 auto;
  73. background: #409eff;
  74. border-color: #409eff;
  75. display: block;
  76. color: #fff;
  77. border-radius: 3px;
  78. font-size: 14px;
  79. cursor: pointer;
  80. }
  81. </style> <!--[if lt IE 10]>
  82. <script type="text/javascript">
  83. document.write("<div style='position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; width: 100%; height: 100%; padding-top: 30px; background-color: #fff;overflow: auto;'><div style='font-size: 26px; padding-left:60px'><p style='margin-bottom: 30px;font-size: 30px; text-align:center;'>您的浏览器版本太低了,为了达到最佳的浏览效果</p><p style='margin-bottom: 30px;'>一、请使用高版本IE浏览器或者谷歌浏览器!<img src='/apps/space/images/login/Chrome.jpg' style='width:50px;display:inline-block;vertical-align:middle;' /></p>二、若您使用双核浏览器,如360浏览器,请您切换“极速模式”浏览!<p style='margin-top: 30px;font-size: 22px;'>(1)点击地址栏的内核切换按钮,可以手动切换浏览模式。</p><p style='margin: 30px 0;'><img src='/apps/space/images/login/3601.png'style='width:980px' /></p><p style='margin: 30px 0;font-size: 22px;'>(2)选择“极速模式”</p><p style='margin-bottom: 30px;'><img src='/apps/space/images/login/3602.png' style='width:980px' /></p></div></div>")
  84. </script>
  85. <![endif]-->
  86. </head>
  87. <body>
  88. <%-- 登录页未挂载 Vue,勿用 v-cloak;否则前置脚本异常时会一直 display:none 导致白屏 --%>
  89. <div id="space-content" style="display:block;">
  90. <div class="login-content">
  91. <div class="login-logo">
  92. <a href="javascript:;">
  93. <img src="${curWebSiteObj.whiteLogoFile}" />
  94. </a>
  95. </div>
  96. <div class="login-right">
  97. <div id="content" class="login-box">
  98. <!-- 账号密码登录 -->
  99. <div class="login-account login-item">
  100. <!-- 右上角图标 -->
  101. <div class="login-icon">
  102. <img src="/apps/space/images/qrcode-icon.png" alt="">
  103. </div>
  104. <!-- 登录头像 -->
  105. <div class="login-user-img">
  106. <img id="b" src="" style="animation-duration: 500ms" />
  107. <div class="user-img-cover">
  108. <img src="/imgs/switch.png" alt="" />
  109. </div>
  110. </div>
  111. <div id="c" class="login-user-name"></div>
  112. <h2>
  113. 账号密码登录
  114. </h2>
  115. <div class="login-form login-box-form">
  116. <div class="login-write">
  117. <p class="login-user">
  118. <i class="iconfont spaceicon icon-username"></i>
  119. <input type="text" id="uname" name="uname" autocomplete="off" value=""
  120. placeholder="用户名" />
  121. </p>
  122. <p class="login-password">
  123. <i class="iconfont spaceicon icon-password2"></i>
  124. <input type="password" id="upwd" name="upwd" autocomplete="off" value=""
  125. placeholder="密 码" readonly onfocus="this.removeAttribute('readonly');" />
  126. </p>
  127. </div>
  128. <div class="login-warn"></div>
  129. <input class="submit" type="button" value="登 录" />
  130. </div>
  131. </div>
  132. <!-- 扫码登录 -->
  133. <div class="login-QRcode login-item">
  134. <!-- 右上角图标 -->
  135. <div class="login-icon">
  136. <img src="/apps/space/images/pc-icon.png" alt="">
  137. </div>
  138. <h2>
  139. 打开微信扫一扫登录
  140. </h2>
  141. <div class="login-form login-box-form">
  142. <div id="qrcode"></div>
  143. <div class="login-states states-succeed">
  144. <i class="spaceicon icon-succeed"></i>
  145. <div>扫码成功</div>
  146. </div>
  147. <div class="login-states states-failed">
  148. <i class="spaceicon icon-failed2" style="color: #F56C6C;"></i>
  149. <div>二维码过期</div>
  150. <input class="refresh" type="button" value="刷 新" onclick="qrcodeLogin()"/>
  151. </div>
  152. <div class="login-states states-cancel">
  153. <i class="spaceicon icon-failed2" style="color: #F56C6C;"></i>
  154. <div>已取消登录</div>
  155. <input class="refresh" type="button" value="刷 新" onclick="qrcodeLogin()"/>
  156. </div>
  157. </div>
  158. </div>
  159. <div id="verify" style="animation-duration: 500ms"></div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </body>
  165. <script src="/js/space.login.js?v=20261109-login-2" type="text/javascript" charset="utf-8"></script>
  166. <script src="/js/Sprite.js" type="text/javascript" charset="utf-8"></script>
  167. <script src="/js/jquery.qrcode.min.js" type="text/javascript" charset="utf-8"></script>
  168. <script type="text/javascript">
  169. $("#space-content").removeAttr("v-cloak").show();
  170. if (window.top != window.self) {
  171. top.location.href = "/console";
  172. }
  173. // 扫码切换
  174. $(function () {
  175. $(".login-icon").on("click", function () {
  176. $(".login-item").hide();
  177. $(this).parent().siblings(".login-item").show();
  178. qrcodeLogin();
  179. })
  180. })
  181. </script>
  182. <script>
  183. var msg = "${msg}";
  184. if (msg.length != 0) {
  185. $(".login-warn").html(msg);
  186. }
  187. </script>
  188. <script type="text/javascript">
  189. document.onkeydown = function (e) { // 回车提交表单
  190. // 兼容FF和IE和Opera
  191. var theEvent = window.event || e;
  192. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  193. if (code == 13) {
  194. $(".submit").click();
  195. }
  196. }
  197. </script>
  198. <script type="text/javascript">
  199. var verifyQrcode = undefined;
  200. var winInterval = undefined;
  201. var qrcodeFlag = true;
  202. var loginUrl = '<app:token name='sys.login' />';
  203. function qrcodeLogin() {
  204. if (winInterval == undefined) {
  205. $(".states-failed").hide();
  206. $(".states-succeed").hide();
  207. $(".states-cancel").hide();
  208. space.utils.ajax({
  209. url: '<app:token name='sys.wechat_scan_qrcode' />',
  210. dataType: 'json',
  211. loadLayer: false,
  212. callback: function (data) {
  213. if (data.code == 'success') {
  214. verifyQrcode = data.data;
  215. qrcode(verifyQrcode);
  216. }
  217. }
  218. });
  219. return;
  220. }
  221. else {
  222. window.clearInterval(winInterval);
  223. winInterval = undefined;
  224. }
  225. }
  226. function qrcode(verifyQrcode) {
  227. var uri = '<app:token name='sys.wechat_scan_url' page='10167' />';
  228. jQuery(function () {
  229. if (qrcodeFlag) {
  230. $('#qrcode').html('');
  231. jQuery('#qrcode').qrcode(window.location.protocol + "//" + window.location.hostname + uri + "&loginToken=" + verifyQrcode.loginToken);
  232. qrcodeFlag = false;
  233. }
  234. })
  235. winInterval = setInterval(function () {
  236. // 是否可登录
  237. $.ajax({
  238. type: "post",
  239. url: '<app:token name='sys.verify_qrcode' />',
  240. data: verifyQrcode,
  241. async: true,
  242. cache: false,
  243. dataType: 'json',
  244. success: function (data) {
  245. if (data.code == 'success') {
  246. var tmpData = data.data;
  247. if (tmpData.code == 10004) {
  248. window.clearInterval(winInterval);
  249. winInterval = undefined;
  250. qrcodeFlag = true;
  251. $(".states-failed").show();
  252. }
  253. else if (tmpData.code == 10001) {
  254. $(".states-failed").hide();
  255. $(".states-succeed").show();
  256. }
  257. else if (tmpData.code == 10002) {
  258. window.clearInterval(winInterval);
  259. winInterval = undefined;
  260. qrcodeFlag = true;
  261. $(".states-failed").hide();
  262. $(".states-succeed").hide();
  263. $(".states-cancel").show();
  264. }
  265. else if (tmpData.code == 10006) {
  266. top.location.href = "/apps/workbench/";
  267. }
  268. }
  269. }
  270. });
  271. }, 3000);
  272. }
  273. </script>
  274. <script type="text/javascript">space.vars.pageTypeCode = "10005";</script>
  275. <script type="text/javascript">space.vars.pageHashCode = "0stYP0tb3FG5Za5VXua8pQ==";</script>
  276. <script type="text/javascript" >removeTokens("<app:token name='sys.removeToken' />", '<%= pageContext.getAttribute(space.core.apps.common.ConstVars.TOKEN_SESSION_LIST_KEY) %>')</script>
  277. </html>