index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="renderer" content="webkit">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta http-equiv="pragma" content="no-cache">
  8. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  9. <meta http-equiv="expires" content="0">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="./css/index.css">
  12. <link rel="stylesheet" href="./css/style.css">
  13. <script src="./js/vue.min.js"></script>
  14. <script src="./js/index.js"></script>
  15. <script src="./js/jquery.min.js"></script>
  16. <style type="text/css">
  17. .logoBox{
  18. position: absolute;
  19. top: 50%;
  20. left: 50%;
  21. text-align: center;
  22. transform: translate(-50%,-50%);
  23. }
  24. .logoBox .logoInfo{
  25. color: #fff;
  26. width: 340px;
  27. padding: 20px;
  28. border-radius: 6px;
  29. box-shadow: 0 0 2.5vw #0a3887 inset;
  30. background: linear-gradient(#0a3887, #0a3887) left top, linear-gradient(#0a3887, #0a3887) left top, linear-gradient(#0a3887, #0a3887) right top, linear-gradient(#0a3887, #0a3887) right top, linear-gradient(#0a3887, #0a3887) left bottom, linear-gradient(#0a3887, #0a3887) left bottom, linear-gradient(#0a3887, #0a3887) right bottom, linear-gradient(#0a3887, #0a3887) right bottom;
  31. background-repeat: no-repeat;
  32. background-size: 0.1vw 18vw, 1.5vw 0.1vw;
  33. }
  34. .logoInfo .el-input__inner{
  35. background-color: rgba(255, 255, 255, 1) !important;
  36. border: none;
  37. color: #000;
  38. border-radius: 0;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div id="app" style="height: 100vh;background-color:#040d32;">
  44. <div class="logoBox">
  45. <div class="logoInfo">
  46. <div class="text-bold text-lg" style="margin-bottom: 40px;color: #0081ff;">船舶智能监控系统</div>
  47. <div class="br_all margin-tb radius flex" style="overflow: hidden;">
  48. <div style="width: 60px;background-color: #0081ff;" class="padding-tb-sm"><i class="el-icon-user"></i></div>
  49. <div class="flex" style="width: calc(100% - 60px);">
  50. <el-input placeholder="请输入账号" v-model="userName" @keyup.enter.native="logIn" clearable></el-input>
  51. </div>
  52. </div>
  53. <div class="br_all radius flex" style="overflow: hidden;">
  54. <div style="width: 60px;background-color:#0081ff;" class="padding-tb-sm"><i class="el-icon-lock"></i></div>
  55. <div class="flex" style="width: calc(100% - 60px);">
  56. <el-input placeholder="请输入密码" v-model="userPwd" @keyup.enter.native="logIn" show-password clearable></el-input>
  57. </div>
  58. </div>
  59. <div class="br_all margin-top radius flex" style="overflow: hidden;">
  60. <div style="width: 60px;background-color:#0081ff;" class="padding-tb-sm"><i class="el-icon-key"></i></div>
  61. <div class="flex" style="width: calc(100% - 60px);">
  62. <el-input placeholder="验证码" v-model="codePwd" @keyup.enter.native="logIn" clearable></el-input>
  63. <img :src="codeImg" style="height: 40px;">
  64. </div>
  65. </div>
  66. <el-button type="primary" @click="logIn" style="width: 100%;margin-top: 30px;" :loading="logining">登录</el-button>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- <script src="./js/login.58235.js"></script> -->
  71. <script>
  72. var _this;
  73. new Vue({
  74. el: '#app',
  75. data: function() {
  76. return {
  77. userName: "",
  78. userPwd: "",
  79. codeImg: "",
  80. codePwd: "",
  81. uuId: "",
  82. logining: false
  83. }
  84. },
  85. created() {
  86. _this = this;
  87. _this.getCode();
  88. _this.checkUuid(0);
  89. let _src = window.location.href.split("?id=");
  90. defUrl = _src.length > 1?_src[1]:"main";
  91. if (localStorage.getItem("ylToken") != "null" && localStorage.getItem("ylToken") != null) {
  92. top.location.href = "./view/"+defUrl+".html";
  93. } else {
  94. }
  95. },
  96. methods: {
  97. checkUuid(num){
  98. $.ajax({
  99. url: "http://39.98.35.167:9999/gps-web/h5/blogin?&_t="+new Date().getTime(),
  100. type: "GET",
  101. dataType: "JSON",
  102. async: true,
  103. data:{},
  104. error: function(XMLHttpRequest) {
  105. console.log(11111)
  106. },
  107. success:function (res) {
  108. if(res.result!=""){
  109. _this.getSeId(res.result.uuid,num);
  110. }
  111. }
  112. })
  113. },
  114. getSeId(code,_num){
  115. $.ajax({
  116. url: "http://39.98.35.167:9999/gps-web/h5/login?_t="+new Date().getTime(),
  117. type: "POST",
  118. dataType: "JSON",
  119. contentType: 'application/json; charset=UTF-8',
  120. async: true,
  121. data: JSON.stringify({
  122. code: null,
  123. codeId: code,
  124. h5login: true,
  125. loginLang: "zh_CN",
  126. loginType: "user",
  127. loginWay: "ie",
  128. password: "7fab5a55668350a90785f2bc72c18220",
  129. plateColor: "1",
  130. smsCode: null,
  131. userId: "gzyz"
  132. }),
  133. error: function(XMLHttpRequest) {
  134. console.log(11111)
  135. },
  136. success:function (res) {
  137. if(res.result!=""){
  138. _SeId = res.result.split("ok#")[1];
  139. if(_num == 1){
  140. _this.getCTok();
  141. }
  142. }
  143. }
  144. })
  145. },
  146. getCTok(){
  147. $.ajax({
  148. url: "http://39.98.35.167:9999/gps-web/h5/alogin?sessionId="+_SeId+"&_t="+new Date().getTime(),
  149. type: "GET",
  150. dataType: "JSON",
  151. async: true,
  152. data:{},
  153. error: function(XMLHttpRequest) {
  154. console.log(11111)
  155. },
  156. success:function (res) {
  157. if(res.result!=""){
  158. localStorage.removeItem("AjaxGen");
  159. localStorage.setItem("AjaxGen",res.result.authorization);
  160. top.location.href = "./view/"+defUrl+".html";
  161. }else{
  162. _this.checkUuid(1);
  163. }
  164. }
  165. })
  166. },
  167. getCode(){
  168. $.ajax({
  169. url: "http://121.37.6.200:8088/captchaImage",
  170. type: "GET",
  171. dataType: "JSON",
  172. async: true,
  173. data:{},
  174. error: function(XMLHttpRequest) {
  175. console.log(11111)
  176. },
  177. success:function (res) {
  178. if(res.code == 200){
  179. _this.uuId = res.uuid;
  180. _this.codeImg = "data:image/jpg;base64,"+res.img;
  181. }
  182. }
  183. })
  184. },
  185. logIn(){
  186. if(_this.userName == ""){
  187. _this.$message({
  188. message: '请填写用户账号!',
  189. type: 'warning'
  190. });
  191. return;
  192. }
  193. if(_this.userPwd == ""){
  194. _this.$message({
  195. message: '请填写用户密码!',
  196. type: 'warning'
  197. });
  198. return;
  199. }
  200. if(_this.codePwd == ""){
  201. _this.$message({
  202. message: '请填写验证码!',
  203. type: 'warning'
  204. });
  205. return;
  206. }
  207. _this.logining = true;
  208. $.ajax({
  209. url: "http://121.37.6.200:8088/login",
  210. type: "POST",
  211. dataType: "JSON",
  212. async: false,
  213. contentType: 'application/json; charset=UTF-8',
  214. data: JSON.stringify({
  215. code: _this.codePwd,
  216. password: _this.userPwd,
  217. username: _this.userName,
  218. uuid: _this.uuId
  219. }),
  220. success:function (json) {
  221. if(json.code == 200){
  222. localStorage.removeItem("ylToken");
  223. localStorage.setItem("ylToken",json.token);
  224. _this.getCTok();
  225. }else{
  226. _this.$message({
  227. message: json.msg,
  228. type: 'warning'
  229. });
  230. _this.getCode();
  231. _this.logining = false;
  232. }
  233. }
  234. })
  235. },
  236. keyDown(ev){
  237. console.log(ev)
  238. }
  239. }
  240. })
  241. </script>
  242. </body>
  243. </html>