fix: 解决 tokne 问题
parent
9c0c01a9ce
commit
1a30bfe81d
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import { getToken, setToken } from 'utils/auth'
|
import { getToken, setToken, removeToken } from 'utils/auth'
|
||||||
import { getQuery } from 'utils'
|
import { getQuery } from 'utils'
|
||||||
import { isEmpty, assign } from 'lodash-es'
|
import { isEmpty, assign } from 'lodash-es'
|
||||||
|
|
||||||
|
@ -17,6 +17,10 @@ router.beforeEach(async (to, from, next) => {
|
||||||
if (isEmpty(history.state.current)) {
|
if (isEmpty(history.state.current)) {
|
||||||
assign(history.state, { current: from.fullPath })
|
assign(history.state, { current: from.fullPath })
|
||||||
}
|
}
|
||||||
|
if (to.path === '/sso') {
|
||||||
|
// 进入 sso 页面默认就是没有登录
|
||||||
|
removeToken()
|
||||||
|
}
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
// 判断用户是否处于登录状态
|
// 判断用户是否处于登录状态
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
|
|
Loading…
Reference in New Issue