Fix logout button issue

This commit is contained in:
Angelina Filippova 2019-03-06 01:00:48 +03:00
parent 7652bfcd58
commit 773793f8f4
2 changed files with 6 additions and 17 deletions

View file

@ -33,10 +33,6 @@ export function getUserInfo() {
})
}
export function logout() {
}
const oauth = { loginByUsername, getUserInfo, logout }
const oauth = { loginByUsername, getUserInfo }
export default oauth

View file

@ -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()
},
// 前端 登出