Browse Source

fix: log-out callback

liangliangyin 4 năm trước cách đây
mục cha
commit
23996b3fe5
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      src/components/GlobalHeader/AvatarDropdown.vue

+ 6 - 3
src/components/GlobalHeader/AvatarDropdown.vue

@@ -54,9 +54,12 @@ export default {
         title: this.$t('layouts.usermenu.dialog.title'),
         content: this.$t('layouts.usermenu.dialog.content'),
         onOk: () => {
-          return new Promise((resolve, reject) => {
-            setTimeout(Math.random() > 0.5 ? resolve : reject, 1500)
-          }).catch(() => console.log('Oops errors!'))
+          // return new Promise((resolve, reject) => {
+          //   setTimeout(Math.random() > 0.5 ? resolve : reject, 1500)
+          // }).catch(() => console.log('Oops errors!'))
+          return this.$store.dispatch('Logout').then(() => {
+            this.$router.push({ name: 'login' })
+          })
         },
         onCancel () {}
       })