From 13f87b980adfcaa0a3f5b0854c75bdc7deec8301 Mon Sep 17 00:00:00 2001 From: xing <xingjs@qq.com> Date: 星期六, 25 二月 2023 09:35:47 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/components/login.vue | 143 +++++++++++++++++++++-------------------------- 1 files changed, 63 insertions(+), 80 deletions(-) diff --git a/src/components/login.vue b/src/components/login.vue index 4e4c1af..8b8d3ea 100644 --- a/src/components/login.vue +++ b/src/components/login.vue @@ -19,20 +19,16 @@ <div class="MapMenu"> <iframe id="ifream" - style="border:none" + style="border: none" width="100%" height="100%" v-bind:src="reportUrl" ></iframe> </div> <div class="title_img"> - <img - src="../assets/img/lg_03.png" - alt="" - /> + <img src="../assets/img/lg_03.png" alt="" /> </div> <div class="login"> - <div class="login_title"> <span>鐢ㄦ埛鐧诲綍</span> </div> @@ -50,10 +46,7 @@ size="meddle" autocomplete="off" > - <i - slot="prefix" - class="el-icon-user" - ></i> + <i slot="prefix" class="el-icon-user"></i> </el-input> </el-form-item> @@ -65,10 +58,7 @@ class="nobr" autocomplete="off" > - <i - slot="prefix" - class="el-icon-lock" - ></i> + <i slot="prefix" class="el-icon-lock"></i> </el-input> </el-form-item> @@ -82,12 +72,8 @@ ></el-input> </el-form-item> </el-col> - - <el-col - :span="6" - align="right" - > + <el-col :span="6" align="right"> <validCode v-model="validCode" ref="refresh" @@ -96,16 +82,16 @@ </el-col> </el-form-item> <el-form-item> - <img - src="../assets/img/zhengshu.png" - alt="" - /><span>璇佷功瀹夎涓庢坊鍔犱俊浠荤珯鐐�</span> + <img src="../assets/img/zhengshu.png" alt="" /><span + style="color: black" + >璇佷功瀹夎涓庢坊鍔犱俊浠荤珯鐐�</span + > </el-form-item> <el-form-item> - <img - src="../assets/img/document.png" - alt="" - /><span>浣跨敤甯姪鏂囨。</span> + <img src="../assets/img/document.png" alt="" /><span + style="color: black" + >浣跨敤甯姪鏂囨。</span + > </el-form-item> <el-form-item> <el-button @@ -119,7 +105,8 @@ " :loading="loading" @click="submitForm('loginForm')" - >鐧诲綍</el-button> + >鐧诲綍</el-button + > </el-form-item> </el-form> </div> @@ -127,17 +114,17 @@ </template> <script> -import { getPerms } from '../api/api'; -import validCode from './verificationCode.vue'; -import { mapActions } from 'vuex'; -import moment from 'moment'; +import { getPerms } from "../api/api"; +import validCode from "./verificationCode.vue"; +import { mapActions } from "vuex"; +import moment from "moment"; export default { components: { validCode }, data() { let validUserName = (rule, value, callback) => { if (!value) { - return callback(new Error('鐢ㄦ埛鍚嶄笉鑳戒负绌�')); + return callback(new Error("鐢ㄦ埛鍚嶄笉鑳戒负绌�")); } else { callback(); } @@ -145,49 +132,45 @@ let validPassword = (rule, value, callback) => { if (!value) { - return callback(new Error('瀵嗙爜涓嶈兘涓虹┖')); + return callback(new Error("瀵嗙爜涓嶈兘涓虹┖")); } else { callback(); } }; const checkValidCode = (rule, value, callback) => { - if (!value) { - callback(new Error('璇疯緭鍏ラ獙璇佺爜')); + callback(new Error("璇疯緭鍏ラ獙璇佺爜")); } else if (value.toUpperCase() !== this.validCode.toUpperCase()) { - callback(new Error('楠岃瘉鐮佷笉姝g‘')); + callback(new Error("楠岃瘉鐮佷笉姝g‘")); } else { callback(); } }; return { - validCode: '', + validCode: "", loading: false, loginForm: { - uid: 'admin', - pwd: 'Admin@1234_lf', + uid: "admin", + pwd: "Admin@1234_lf", }, rules: { - uid: [{ validator: validUserName, trigger: 'blur' }], - pwd: [{ validator: validPassword, trigger: 'blur' }], - validCode: [{ validator: checkValidCode, trigger: 'blur' }], - showSessionId: '', - reportUrl: '' + uid: [{ validator: validUserName, trigger: "blur" }], + pwd: [{ validator: validPassword, trigger: "blur" }], + validCode: [{ validator: checkValidCode, trigger: "blur" }], + showSessionId: "", + reportUrl: "", }, }; }, mounted() { - - this.getpublickey(); }, methods: { // 鑾峰彇vuex涓瑼ctions閲岀殑鏂规硶 - ...mapActions(['login', 'getpublickey']), + ...mapActions(["login", "getpublickey"]), getCode(data) { - this.validCode = data; //鍦╠ata涓畾涔変竴涓� validCode:'',鐢ㄦ潵璁板綍楠岃瘉鐮併�� }, @@ -198,36 +181,36 @@ this.login(this.loginForm) .then((response) => { if (response.code != 200) { - this.loading = false + this.loading = false; Message({ message: response.msg, - type: 'error', + type: "error", duration: 5 * 1000, }); - return + return; } if (response.msg != "") { this.$message({ message: response.msg, - type: 'warning' + type: "warning", }); } this.setCookies(response); getPerms().then((res) => { if (res.code == 200) { - this.$store.commit('getPermsEntity', res.result); + this.$store.commit("getPermsEntity", res.result); if (res.result.length != 0) { - sessionStorage.setItem('routerName', '/Synthesis') - sessionStorage.setItem('changeSelectStyle', 3) - this.$router.push('/'); + sessionStorage.setItem("routerName", "/Synthesis"); + sessionStorage.setItem("changeSelectStyle", 3); + this.$router.push("/"); } - this.loading = false + this.loading = false; } else { - this.loading = false - console.log('error submit!!'); + this.loading = false; + console.log("error submit!!"); } }); @@ -239,52 +222,52 @@ }); //濡傛灉鐧诲綍澶辫触锛岄渶瑕佸埛鏂伴獙璇佺爜鐨� this.$refs.refresh.createdCode(); - this.validCode = ''; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹� + this.validCode = ""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹� } else { - this.loading = false - console.log('error submit!!'); + this.loading = false; + console.log("error submit!!"); return false; } }); }, setCookies(res) { - - var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss'); + var timeData = moment(res.result.expire).format("YYYY-MM-DD HH:mm:ss"); var LfPrems = { token: res.result.token, uname: res.result.uname, time: timeData, userid: res.result.createUser, - expire: res.result.expire + expire: res.result.expire, }; LfPrems = JSON.stringify(LfPrems); - localStorage.setItem('LFToken', LfPrems); + localStorage.setItem("LFToken", LfPrems); }, enterLogin() { document.onkeydown = (e) => { e = window.event || e; - - if (this.$route.path == '/login' && (e.code == 'Enter' || e.code == 'enter' || e.code == 'NumpadEnter')) { - + if ( + this.$route.path == "/login" && + (e.code == "Enter" || e.code == "enter" || e.code == "NumpadEnter") + ) { //鏈�閲嶈鏈�鍚庤皟鐢�1.鐧诲綍鏍¢獙鏂规硶 //this.login(); - this.submitForm('loginForm') + this.submitForm("loginForm"); } }; - }, startURL() { - var url = window.location.href; - var testurl = ''; - if (url.indexOf('web') != -1) { - testurl = '/web'; + var url = window.location.href; + var testurl = ""; + if (url.indexOf("web") != -1) { + testurl = "/web"; } - this.reportUrl = window.location.origin + testurl + '/mapscreen/index.html'; - } + this.reportUrl = + window.location.origin + testurl + "/mapscreen/index.html"; + }, }, created() { - this.startURL() + this.startURL(); this.enterLogin(); }, }; @@ -337,7 +320,7 @@ left: 75%; top: 45%; transform: translate(-50%, -40%); - background: rgba(255, 255, 255, 0.8); + background: rgba(255, 255, 255, 0.9); border-radius: 8px; } -- Gitblit v1.9.3