提交 e404d647 authored 作者: lidongxu's avatar lidongxu

refactor(login): 获取勤策回传 URL 的位置是第二个 ? 后面

同上
上级 6e3cf651
...@@ -44,8 +44,8 @@ export default defineStore( ...@@ -44,8 +44,8 @@ export default defineStore(
} else if (type === 'qc') { } else if (type === 'qc') {
// 勤策登录 // 勤策登录
qcLogin(data).then(res => { qcLogin(data).then(res => {
setToken(res.data.access_token) setToken(res.access_token)
this.token = res.data.access_token this.token = res.access_token
resolve() resolve()
}) })
} }
......
...@@ -149,11 +149,9 @@ checkFsLoginAuth() ...@@ -149,11 +149,9 @@ checkFsLoginAuth()
// 检查-是否勤策回跳,并客户端登录 // 检查-是否勤策回跳,并客户端登录
const checkQcLoginAuth = async () => { const checkQcLoginAuth = async () => {
const params = new URLSearchParams(window.location.href.split('?')[1]); const isState = window.location.href.includes('state')
const state = params.get('state'); if (isState) {
console.log(state, 'state') loginByType('qc', window.location.href.split('?')[2])
if (state === 'STATE') {
loginByType('qc', window.location.href.split('?')[1])
} else { } else {
isShowLogin.value = true isShowLogin.value = true
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论