增加jwt主动失效功能(next:多点登录限制
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { login } from '@/api/user'
|
||||
import { jsonInBlacklist } from '@/api/jwt'
|
||||
import router from '@/router/index'
|
||||
export const user = {
|
||||
namespaced: true,
|
||||
@@ -52,6 +53,12 @@ export const user = {
|
||||
router.push({ path: '/layout/dashbord' })
|
||||
}
|
||||
}
|
||||
},
|
||||
async LoginOut({ commit }) {
|
||||
const res = await jsonInBlacklist()
|
||||
if (res.success) {
|
||||
commit("LoginOut")
|
||||
}
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
|
||||
Reference in New Issue
Block a user