forked from AkkomaGang/admin-fe
Fix logout button issue
This commit is contained in:
parent
7652bfcd58
commit
773793f8f4
2 changed files with 6 additions and 17 deletions
|
@ -33,10 +33,6 @@ export function getUserInfo() {
|
|||
})
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
|
||||
}
|
||||
|
||||
const oauth = { loginByUsername, getUserInfo, logout }
|
||||
const oauth = { loginByUsername, getUserInfo }
|
||||
|
||||
export default oauth
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { loginByUsername, logout, getUserInfo } from '@/api/login'
|
||||
import { loginByUsername, getUserInfo } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
|
||||
const user = {
|
||||
|
@ -103,17 +103,10 @@ const user = {
|
|||
// },
|
||||
|
||||
// 登出
|
||||
LogOut({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_ROLES', [])
|
||||
removeToken()
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
LogOut({ commit }) {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_ROLES', [])
|
||||
removeToken()
|
||||
},
|
||||
|
||||
// 前端 登出
|
||||
|
|
Loading…
Reference in a new issue