From 80e0b9da4d4da98452f8930b148750763d85f090 Mon Sep 17 00:00:00 2001 From: “dzb” <2632970487@qq.com> Date: 星期二, 27 九月 2022 23:12:14 +0800 Subject: [PATCH] 修改用户管理和角色管理部分问题 --- src/views/login/index.vue | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index ee4f317..a13548a 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,12 @@ pwdType: false, }; }, - created() { }, + created() { + const pic = JSON.parse(localStorage.getItem('pic')); + if(pic){ + this.imgUrl = pic.loginPageIconUrl + } + }, methods: { showPwd() { if (!this.pwdType) { @@ -103,21 +109,20 @@ }, ...mapActions(["login"]), handleLogin() { - console.log("in login"); const { username, password } = this.loginForm; const that = this; this.$axios - .post("http://42.193.1.25:8082/sccg/admin/login", { + .post("sccg/admin/login", { password, username, }) .then(function (response) { - if (response.data.code === 200) { + if (response.code === 200) { // 淇濆瓨token console.log(response); - localStorage.setItem('token',response.data.data.token); + sessionStorage.setItem('token',response.data.token); // 淇濆瓨token - localStorage.setItem('tokenHead',response.data.data.tokenHead) + sessionStorage.setItem('tokenHead',response.data.tokenHead) // 璺宠浆鍒伴椤� that.$router.push("/home"); }else{ -- Gitblit v1.8.0