Commit cf90e32a by liangjianmin

js

parent ac9c65bb
Showing with 2 additions and 6 deletions
...@@ -15,7 +15,7 @@ export let NODE_ENVS = "/"; ...@@ -15,7 +15,7 @@ export let NODE_ENVS = "/";
switch (envs) { switch (envs) {
case 'development': case 'development':
//开发环境 //开发环境
NODE_ENVS = 'http://192.168.2.164:8080'; NODE_ENVS = 'http://192.168.2.142:8080';
break; break;
case 'test': case 'test':
//测试环境 //测试环境
......
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
} else { } else {
this.$http('get', "/api/user/getuserinfo").then(res => { this.$http('get', "/api/user/getuserinfo").then(res => {
this.userinfo = res.data; this.userinfo = res.data;
if(res.data){ if (res.data) {
sessionStorage.setItem('userInfox', JSON.stringify(res.data)); sessionStorage.setItem('userInfox', JSON.stringify(res.data));
} }
...@@ -301,13 +301,9 @@ ...@@ -301,13 +301,9 @@
logout() { logout() {
this.$http('post', "/auth/logout").then(res => { this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token'); Util.delCookie('token');
if (res.err_code === 0) {
window.location.href = '/#/login'; window.location.href = '/#/login';
sessionStorage.removeItem('userInfox') sessionStorage.removeItem('userInfox')
history.go(0); history.go(0);
} else {
Message(res.err_msg);
}
}).catch(err => { }).catch(err => {
console.log(err.message); console.log(err.message);
}) })
......
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 sign in to comment