Commit addbb88b by LJM

bug

parent 56075462
Showing with 15 additions and 8 deletions
......@@ -177,7 +177,7 @@
<script>
import Vue from 'vue';
import Util from "../tool";
import {Button, Dialog, Form, FormItem, Input, Menu, MenuItem, MenuItemGroup, Message, Submenu, Tooltip} from 'element-ui'
import {Button, Dialog, Form, FormItem, Input, Menu, MenuItem, MenuItemGroup, Message, Submenu, Tooltip,MessageBox} from 'element-ui'
Vue.prototype.$message = Message;
Vue.use(Menu).use(MenuItem).use(MenuItemGroup).use(Submenu).use(Form).use(FormItem).use(Dialog).use(Button).use(Tooltip).use(Input);
......@@ -388,14 +388,21 @@ export default {
});
},
logout() {
this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token');
window.location.href = '/#/login';
window.userInfo = ""
history.go(0);
}).catch(err => {
console.log(err.message);
MessageBox.confirm('确定退出系统吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token');
window.location.href = '/#/login';
window.userInfo = ""
history.go(0);
}).catch(err => {
console.log(err.message);
})
}).catch(() => {
})
}
}
}
......
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