123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
- <meta http-equiv="expires" content="0">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <link rel="stylesheet" href="./css/index.css">
- <link rel="stylesheet" href="./css/style.css">
- <script src="./js/vue.min.js"></script>
- <script src="./js/index.js"></script>
- <script src="./js/jquery.min.js"></script>
- <style type="text/css">
- .logoBox{
- position: absolute;
- top: 50%;
- left: 50%;
- text-align: center;
- transform: translate(-50%,-50%);
- }
- .logoBox .logoInfo{
- color: #fff;
- width: 340px;
- padding: 20px;
- border-radius: 6px;
- box-shadow: 0 0 2.5vw #0a3887 inset;
- 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;
- background-repeat: no-repeat;
- background-size: 0.1vw 18vw, 1.5vw 0.1vw;
- }
- .logoInfo .el-input__inner{
- background-color: rgba(255, 255, 255, 1) !important;
- border: none;
- color: #000;
- border-radius: 0;
- }
-
- </style>
- </head>
- <body>
- <div id="app" style="height: 100vh;background-color:#040d32;">
- <div class="logoBox">
- <div class="logoInfo">
- <div class="text-bold text-lg" style="margin-bottom: 40px;color: #0081ff;">船舶智能监控系统</div>
- <div class="br_all margin-tb radius flex" style="overflow: hidden;">
- <div style="width: 60px;background-color: #0081ff;" class="padding-tb-sm"><i class="el-icon-user"></i></div>
- <div class="flex" style="width: calc(100% - 60px);">
- <el-input placeholder="请输入账号" v-model="userName" @keyup.enter.native="logIn" clearable></el-input>
- </div>
- </div>
- <div class="br_all radius flex" style="overflow: hidden;">
- <div style="width: 60px;background-color:#0081ff;" class="padding-tb-sm"><i class="el-icon-lock"></i></div>
- <div class="flex" style="width: calc(100% - 60px);">
- <el-input placeholder="请输入密码" v-model="userPwd" @keyup.enter.native="logIn" show-password clearable></el-input>
- </div>
- </div>
- <div class="br_all margin-top radius flex" style="overflow: hidden;">
- <div style="width: 60px;background-color:#0081ff;" class="padding-tb-sm"><i class="el-icon-key"></i></div>
- <div class="flex" style="width: calc(100% - 60px);">
- <el-input placeholder="验证码" v-model="codePwd" @keyup.enter.native="logIn" clearable></el-input>
- <img :src="codeImg" style="height: 40px;">
- </div>
- </div>
- <el-button type="primary" @click="logIn" style="width: 100%;margin-top: 30px;" :loading="logining">登录</el-button>
- </div>
- </div>
- </div>
- <!-- <script src="./js/login.58235.js"></script> -->
- <script>
- var _this;
- new Vue({
- el: '#app',
- data: function() {
- return {
- userName: "",
- userPwd: "",
- codeImg: "",
- codePwd: "",
- uuId: "",
- logining: false
- }
- },
- created() {
- _this = this;
- _this.getCode();
- _this.checkUuid(0);
- let _src = window.location.href.split("?id=");
- defUrl = _src.length > 1?_src[1]:"main";
- if (localStorage.getItem("ylToken") != "null" && localStorage.getItem("ylToken") != null) {
- top.location.href = "./view/"+defUrl+".html";
- } else {
- }
- },
- methods: {
- checkUuid(num){
- $.ajax({
- url: "http://39.98.35.167:9999/gps-web/h5/blogin?&_t="+new Date().getTime(),
- type: "GET",
- dataType: "JSON",
- async: true,
- data:{},
- error: function(XMLHttpRequest) {
- console.log(11111)
- },
- success:function (res) {
- if(res.result!=""){
- _this.getSeId(res.result.uuid,num);
- }
- }
- })
- },
- getSeId(code,_num){
- $.ajax({
- url: "http://39.98.35.167:9999/gps-web/h5/login?_t="+new Date().getTime(),
- type: "POST",
- dataType: "JSON",
- contentType: 'application/json; charset=UTF-8',
- async: true,
- data: JSON.stringify({
- code: null,
- codeId: code,
- h5login: true,
- loginLang: "zh_CN",
- loginType: "user",
- loginWay: "ie",
- password: "7fab5a55668350a90785f2bc72c18220",
- plateColor: "1",
- smsCode: null,
- userId: "gzyz"
- }),
- error: function(XMLHttpRequest) {
- console.log(11111)
- },
- success:function (res) {
- if(res.result!=""){
- _SeId = res.result.split("ok#")[1];
- if(_num == 1){
- _this.getCTok();
- }
- }
- }
- })
- },
- getCTok(){
- $.ajax({
- url: "http://39.98.35.167:9999/gps-web/h5/alogin?sessionId="+_SeId+"&_t="+new Date().getTime(),
- type: "GET",
- dataType: "JSON",
- async: true,
- data:{},
- error: function(XMLHttpRequest) {
- console.log(11111)
- },
- success:function (res) {
- if(res.result!=""){
- localStorage.removeItem("AjaxGen");
- localStorage.setItem("AjaxGen",res.result.authorization);
- top.location.href = "./view/"+defUrl+".html";
- }else{
- _this.checkUuid(1);
- }
- }
- })
- },
- getCode(){
- $.ajax({
- url: "http://121.37.6.200:8088/captchaImage",
- type: "GET",
- dataType: "JSON",
- async: true,
- data:{},
- error: function(XMLHttpRequest) {
- console.log(11111)
- },
- success:function (res) {
- if(res.code == 200){
- _this.uuId = res.uuid;
- _this.codeImg = "data:image/jpg;base64,"+res.img;
- }
- }
- })
- },
- logIn(){
- if(_this.userName == ""){
- _this.$message({
- message: '请填写用户账号!',
- type: 'warning'
- });
- return;
- }
- if(_this.userPwd == ""){
- _this.$message({
- message: '请填写用户密码!',
- type: 'warning'
- });
- return;
- }
- if(_this.codePwd == ""){
- _this.$message({
- message: '请填写验证码!',
- type: 'warning'
- });
- return;
- }
- _this.logining = true;
- $.ajax({
- url: "http://121.37.6.200:8088/login",
- type: "POST",
- dataType: "JSON",
- async: false,
- contentType: 'application/json; charset=UTF-8',
- data: JSON.stringify({
- code: _this.codePwd,
- password: _this.userPwd,
- username: _this.userName,
- uuid: _this.uuId
- }),
- success:function (json) {
- if(json.code == 200){
- localStorage.removeItem("ylToken");
- localStorage.setItem("ylToken",json.token);
- _this.getCTok();
- }else{
- _this.$message({
- message: json.msg,
- type: 'warning'
- });
- _this.getCode();
- _this.logining = false;
- }
- }
- })
- },
- keyDown(ev){
- console.log(ev)
- }
- }
- })
- </script>
- </body>
- </html>
|