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