update 单点登录

This commit is contained in:
赵霄
2023-10-31 15:38:02 +08:00
parent 73866b6346
commit 9ac308e17e
+1 -1
View File
@@ -16,7 +16,7 @@ whiteList.push(OAUTH2_LOGIN_PAGE_PATH)
router.beforeEach(async (to, from, next) => {
console.log(to.query)
// 单点登录
if (to.query.code) {
if (to.query.code && !Vue.ls.get(ACCESS_TOKEN)) {
const { result } = await getSSOUserInfo({ code: to.query.code })
const userInfo = result.userInfo
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)