From 1445c7e1f76c4628f4619cf67150a63d6f8f5e90 Mon Sep 17 00:00:00 2001 From: mg <maokecheng@163.com> Date: 星期二, 01 十一月 2022 09:04:16 +0800 Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui --- src/views/login/index.vue | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index d33b057..0da15ac 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -4,7 +4,7 @@ <div class="text"> <div class="logo"> <img - src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__155eeb2ceaac89ec717869a050964a36.svg" + :src="imgUrl" alt=""> </div> <div class="text-r"> @@ -80,6 +80,7 @@ // username: "admin", // password: "macro123", }, + imgUrl:'', loginRules: { username: [ { required: true, trigger: "blur", validator: validateUsername }, @@ -92,7 +93,19 @@ pwdType: false, }; }, - created() { }, + created() { + const pic = JSON.parse(sessionStorage.getItem('pic')); + if(pic){ + this.imgUrl = pic.loginPageIconUrl + }else{ + this.$axios({ + method: 'get', + url: 'sccg/system/portal/logo/search', + }).then(res => { + this.imgUrl = res.data.loginPageIconUrl + }) + } + }, methods: { showPwd() { if (!this.pwdType) { @@ -103,9 +116,9 @@ }, ...mapActions(["login"]), handleLogin() { - console.log("in login"); const { username, password } = this.loginForm; const that = this; + console.log(this.login); this.$axios .post("sccg/admin/login", { password, @@ -113,17 +126,23 @@ }) .then(function (response) { if (response.code === 200) { + // 璁剧疆toke鏃堕棿 // 淇濆瓨token console.log(response); - localStorage.setItem('token',response.data.token); + sessionStorage.setItem('token',response.data.token); // 淇濆瓨token - localStorage.setItem('tokenHead',response.data.tokenHead) + sessionStorage.setItem('tokenHead',response.data.tokenHead); + // 淇濆瓨鐢ㄦ埛鐧诲綍鍚� + sessionStorage.setItem('name',username); // 璺宠浆鍒伴椤� that.$router.push("/home"); }else{ that.$refs.loginForm.validate((valid)=>{ if(valid){ - that.$message.error(response.data.message); + that.$message({ + type:'warning', + message:response.message + }) } }) } @@ -157,6 +176,10 @@ top: 20%; right: 5%; width: 360px; + &:deep(.el-input__inner){ + background-color: #fff !important; + border: 1px solid #dcdfe6 !important; + } } .text { @@ -171,6 +194,7 @@ .logo>img { width: 75px; height: 75px; + border-radius: 4px; } .text-r { -- Gitblit v1.8.0