login.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Roma</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <link rel="icon" type="image/x-ico" href=""/>
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  9. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  10. <link rel="stylesheet" href="./public/static/amis-sdk/helper.css">
  11. <link rel="stylesheet" href="./public/static/amis-sdk/sdk.css">
  12. <!-- 引入自定义样式 -->
  13. <link rel="stylesheet" href="./public/static/css/login.css">
  14. </head>
  15. <body>
  16. <div id="root" class="app-wrapper"></div>
  17. <script type='text/javascript' src='./public/static/amis-sdk/sdk.js'></script>
  18. <!-- 引入语言包 -->
  19. <script src="./lang/en-US.js"></script>
  20. <script src="./lang/zh-CN.js"></script>
  21. <!-- 引入多语言js处理文件,必须先引入语言包 -->
  22. <script src="./public/static/tools/common.js"></script>
  23. <!-- 引入登录页面JSON -->
  24. <script src="./pages/login/login-json.js"></script>
  25. <script type="text/javascript">
  26. (function () {
  27. let amis = amisRequire('amis/embed');
  28. let languageInfo = getLanguageInfo();
  29. // 页面json内容
  30. const amisJSON = getLoginJson()
  31. let amisScoped = amis.embed(
  32. '#root',
  33. amisJSON,
  34. {
  35. locale: languageInfo.lang
  36. },
  37. {
  38. replaceText: languageInfo.langReplaceText,
  39. langReplaceTextIgnoreKeys: languageInfo.langReplaceTextIgnoreKeys
  40. }
  41. );
  42. getVerify();
  43. })();
  44. // 刷新验证码
  45. function refresh_code()
  46. {
  47. getVerify();
  48. // document.querySelector('.code_img').src = 'http://localhost:8081/login/verifyCode?' + Math.random();
  49. }
  50. function getVerify() {
  51. // 创建请求对象
  52. var request = new XMLHttpRequest()
  53. request.open('get', 'http://localhost:8081/login/verifyCode')
  54. request.send()
  55. // 获取网络请求响应的数据
  56. request.onreadystatechange = function () {
  57. // 响应完毕,并且请求成功
  58. if (request.readyState === 4 && request.status === 200) {
  59. var res = JSON.parse(request.responseText)
  60. document.querySelector('.code_img').src = "data:image/jpeg;base64," + res.img;
  61. console.log(res.token)
  62. }
  63. }
  64. }
  65. </script>
  66. <style>
  67. .amis-scope .cxd-InputGroup .cxd-TextControl-input:not(:last-child) {
  68. border-right-width: -1;
  69. border-top-right-radius: 0;
  70. border-bottom-right-radius: 0;
  71. }
  72. </style>
  73. </body>
  74. </html>