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

fix(login): 折腾一圈_回归到最初代码_让勤策控制默认访问哪个页面

然后我们用路由拦截访问即可
上级 16143605
...@@ -151,12 +151,8 @@ checkFsLoginAuth() ...@@ -151,12 +151,8 @@ checkFsLoginAuth()
// 检查-是否勤策回跳,并客户端登录 // 检查-是否勤策回跳,并客户端登录
const checkQcLoginAuth = async () => { const checkQcLoginAuth = async () => {
isShowLogin.value = false isShowLogin.value = false
// 勤策 App 中移动端跳转 https://sfa-qa.wxl66.cn/link/#/m (会被路由拦截打回到登录页面,变成如下参数的格式)- 正确做法是跳转到登录页面(在登录页面判断当前设备是移动端则跳转到 /m 路由)但是频繁让人家改跳转地址不好,所以自己做判断吧 // 参数:?redirect=/m?state=STATE&code=CODE 这个格式
// 移动端:?redirect=/m?state=STATE&code=CODE 这个格式 const url = window.location.href.split('?')[2]
// PC 端:?state=STATE&code=CODE
const url = proxy.isMobile() ? window.location.href.split('?')[2] : window.location.href.split('?')[1]
console.log(url)
if (url) { if (url) {
const params = new URLSearchParams(url); const params = new URLSearchParams(url);
const state = params.get('state'); const state = params.get('state');
...@@ -169,13 +165,7 @@ const checkQcLoginAuth = async () => { ...@@ -169,13 +165,7 @@ const checkQcLoginAuth = async () => {
isShowLogin.value = true isShowLogin.value = true
} }
} }
const t = setInterval(() => { checkQcLoginAuth()
console.log(123)
checkQcLoginAuth()
}, 1000)
onUnmounted(() => {
clearInterval(t)
})
// 工号密码登录 // 工号密码登录
function handleLogin() { function handleLogin() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论