到第三方登录页面时先删除之前的token
This commit is contained in:
parent
d09e415720
commit
ce62a19aa0
@ -3,7 +3,7 @@ import store from '@/store/index';
|
||||
import router from './router/index';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import { setToken, getToken, getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { setToken, getToken, getSessionStorage, setSessionStorage, removeToken } from '@/utils/auth';
|
||||
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
|
||||
import localStore from 'storejs';
|
||||
import { handlerUrl } from '@/utils/baseUrl';
|
||||
@ -84,6 +84,9 @@ function handleRoute(to, next, loginPath) {
|
||||
// }
|
||||
// }
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
if (to.path == '/thirdLogin') { // 到第三方登录页面时先删除之前的token
|
||||
removeToken();
|
||||
}
|
||||
// 判断第三方登陆
|
||||
if (to.query.thirdJump) {
|
||||
setToken(to.query.key);
|
||||
|
@ -53,8 +53,7 @@ export default {
|
||||
deviceCode:deviceCode
|
||||
}, LoginParams.LianKeTang);
|
||||
this.message = '正在登陆中......';
|
||||
// const tokenKey = getToken();
|
||||
const tokenKey = '';
|
||||
const tokenKey = getToken();
|
||||
if (tokenKey) {
|
||||
const header = { group: '', 'X-Token': tokenKey };
|
||||
this.$store.dispatch('setToken', tokenKey);
|
||||
|
Loading…
Reference in New Issue
Block a user