提交 556c385d authored 作者: lidongxu's avatar lidongxu

fix(feishu): 修复:飞书回调地址的变更

上级 d22bcb6f
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<span>其他登录方式</span> <span>其他登录方式</span>
</p> </p>
<div class="group"> <div class="group">
<a :href="fsOAuthUrl + locationHref"> <a :href="fsOAuthUrl">
<img src="@/assets/logo/feishu.png" <img src="@/assets/logo/feishu.png"
alt="" alt=""
class="item"> class="item">
...@@ -73,6 +73,7 @@ import Cookies from "js-cookie" ...@@ -73,6 +73,7 @@ import Cookies from "js-cookie"
import { encrypt, decrypt, getQueryString, param2Obj } from "@/utils" import { encrypt, decrypt, getQueryString, param2Obj } from "@/utils"
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import cache from '@/plugins/cache' import cache from '@/plugins/cache'
const reportBaseDomain = import.meta.env.VITE_APP_REPORT_URL // 基础域名
const userStore = useUserStore() const userStore = useUserStore()
const route = useRoute() const route = useRoute()
...@@ -93,8 +94,6 @@ const loginRules = { ...@@ -93,8 +94,6 @@ const loginRules = {
const accountPassLoading = ref(false) // 账号密码登录状态 const accountPassLoading = ref(false) // 账号密码登录状态
const autoLoginLoading = ref(false) // 自动免登录 const autoLoginLoading = ref(false) // 自动免登录
const redirect = ref(undefined) // 登录后重定向地址 const redirect = ref(undefined) // 登录后重定向地址
const locationHref = ref(window.location.href)
console.log('locationHref', locationHref)
watch(route, (newRoute) => { watch(route, (newRoute) => {
redirect.value = newRoute.query?.redirect redirect.value = newRoute.query?.redirect
...@@ -163,13 +162,13 @@ async function loginByType(type, data) { ...@@ -163,13 +162,13 @@ async function loginByType(type, data) {
data data
}).then(() => { }).then(() => {
const state = getQueryString('state') const state = getQueryString('state')
console.log('state', state)
// 飞书回跳 // 飞书回跳
if (state.includes('fs')) { if (state.includes('fs')) {
const redirectUri = cache.session.get('redirect_uri') // 未遂地址 const redirectUri = cache.session.get('redirect_uri') // 未遂地址
if (redirectUri) { if (redirectUri) {
cache.session.remove('redirect_uri') cache.session.remove('redirect_uri')
router.push({ path: redirectUri || "/", query: param2Obj(redirectUri) }); window.location.href = reportBaseDomain + '/#' + redirectUri
// router.push({ path: redirectUri || "/", query: param2Obj(redirectUri) });
} else { } else {
router.push({ path: "/" }); // 正常飞书客户端里登录 router.push({ path: "/" }); // 正常飞书客户端里登录
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论