Commit addbb88b by LJM

bug

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