Commit 4915527a authored by limeimei's avatar limeimei

修改

parent c8ab42a5
Pipeline #2370 failed with stages
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
}; };
}, },
created(){
this.login()
},
...@@ -21,16 +24,15 @@ ...@@ -21,16 +24,15 @@
methods: { methods: {
login() { login() {
localStorage.removeItem("token"); // localStorage.removeItem('token')
// return
http.post("/sys/dev/user/login", { http.post("/sys/dev/user/login", {
autoLogin: true, autoLogin: true,
userLogin: 'sixiang', userLogin: 'sixiang',
userPassword: 'qwe123', userPassword: 'qwe123',
}).then((res) => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
// localStorage.removeItem("token");
localStorage.setItem('token', res.data.token) localStorage.setItem('token', res.data.token)
console.log(localStorage.getItem('token'))
} }
}); });
}, },
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
methods: { methods: {
login() { login() {
localStorage.removeItem("token"); // localStorage.removeItem("token");
http.post("/sys/dev/user/login", { http.post("/sys/dev/user/login", {
autoLogin: true, autoLogin: true,
userLogin: 'sixiang', userLogin: 'sixiang',
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
if (res.code == 200) { if (res.code == 200) {
// //
localStorage.setItem('token', res.data.token) localStorage.setItem('token', res.data.token)
// console.log(localStorage.getItem('token'))
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment