From 218413d66bf11233fe5b9d3a7fead72b7c20e8da Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期三, 02 十一月 2022 19:09:43 +0800
Subject: [PATCH] 视频巡查细节
---
src/views/login/index.vue | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 81992e8..0da15ac 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -94,9 +94,16 @@
};
},
created() {
- const pic = JSON.parse(localStorage.getItem('pic'));
+ 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: {
@@ -109,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,
@@ -119,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
+ })
}
})
}
@@ -163,6 +176,10 @@
top: 20%;
right: 5%;
width: 360px;
+ &:deep(.el-input__inner){
+ background-color: #fff !important;
+ border: 1px solid #dcdfe6 !important;
+ }
}
.text {
@@ -177,6 +194,7 @@
.logo>img {
width: 75px;
height: 75px;
+ border-radius: 4px;
}
.text-r {
--
Gitblit v1.8.0