Merge branch 'fix/log-out-button' into 'master'
Fix logout button issue Closes #1 See merge request pleroma/admin-fe!3
This commit is contained in:
commit
3c524b3cbb
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