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

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

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