update 单点登录修改

This commit is contained in:
赵霄
2023-10-31 09:59:36 +08:00
parent 184864acfa
commit 40d94cbfb0
+2 -1
View File
@@ -14,8 +14,9 @@ const whiteList = ['/user/login', '/user/register', '/user/register-result', '/u
whiteList.push(OAUTH2_LOGIN_PAGE_PATH)
router.beforeEach(async (to, from, next) => {
console.log(to.query)
// 单点登录
if (to.query.code && top.frames.length > 0) {
if (to.query.code) {
const result = await getSSOUserInfo({ code: to.query.code })
const userInfo = result.userInfo
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)