Commit addbb88b by LJM

bug

parent 56075462
Showing with 8 additions and 1 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,6 +388,9 @@ export default {
});
},
logout() {
MessageBox.confirm('确定退出系统吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token');
window.location.href = '/#/login';
......@@ -396,6 +399,10 @@ export default {
}).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