Explorar o código

feat: after logging out, return to the homepage

Casper Dai %!s(int64=2) %!d(string=hai) anos
pai
achega
02ae92f3d6
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/store/modules/user.js

+ 2 - 0
src/store/modules/user.js

@@ -1,4 +1,5 @@
 import Vue from 'vue'
+import router from '@/router'
 import {
   Role,
   RoleAccess
@@ -161,6 +162,7 @@ const actions = {
     commit('SET_AVATAR', avatar)
   },
   logout () {
+    router.replace({ path: '/' })
     // 登出将跳转页面,所以不需其他操作
     Vue.prototype.$keycloak.logout()
   },