From 2e66717932ddd70ad889eb5d4969665599128810 Mon Sep 17 00:00:00 2001 From: duoaohui <928970622@qq.com> Date: Sat, 23 May 2026 14:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BC=9A=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/auth/login.vue | 26 ++++++ frontend/src/pages/auth/sso.vue | 7 ++ frontend/src/pages/index/index.vue | 28 +++++- frontend/src/pages/meeting/preview.vue | 117 +++++++++++++++---------- frontend/src/utils/request.js | 1 + 5 files changed, 130 insertions(+), 49 deletions(-) diff --git a/frontend/src/pages/auth/login.vue b/frontend/src/pages/auth/login.vue index 0eb081e..ba86553 100644 --- a/frontend/src/pages/auth/login.vue +++ b/frontend/src/pages/auth/login.vue @@ -95,6 +95,29 @@ import { useChatStore } from '@/store/chat' import { useContactStore } from '@/store/contact' import { useNotifyStore } from '@/store/notify' +function readSsoQueryFromLocation() { + try { + if (typeof window === 'undefined') return '' + const hash = String(window.location.hash || '') + if (hash.indexOf('/pages/auth/sso') >= 0 && hash.indexOf('?') >= 0) { + return hash.slice(hash.indexOf('?') + 1) + } + const search = String(window.location.search || '').replace(/^\?/, '') + if (search.indexOf('payload=') >= 0 || search.indexOf('token=') >= 0 || search.indexOf('cloudLawSso=') >= 0) { + return search + } + } catch (e) {} + return '' +} + +function redirectToSsoIfPresent() { + const query = readSsoQueryFromLocation() + if (!query) return false + console.warn('[Login] detected SSO params on login page, redirect to SSO') + uni.redirectTo({ url: `/pages/auth/sso?${query}` }) + return true +} + export default { name: 'LoginPage', data() { @@ -106,6 +129,9 @@ export default { errors: { account: '', password: '' } } }, + onLoad() { + redirectToSsoIfPresent() + }, methods: { /** 失焦时触发对应字段校验 */ onBlur(field) { diff --git a/frontend/src/pages/auth/sso.vue b/frontend/src/pages/auth/sso.vue index dd8c91f..091f21b 100644 --- a/frontend/src/pages/auth/sso.vue +++ b/frontend/src/pages/auth/sso.vue @@ -146,6 +146,13 @@ function bootstrapAfterSso(token) { onLoad((query) => { try { + try { + console.log('[SSO] location:', { + search: typeof window !== 'undefined' ? window.location.search : '', + hash: typeof window !== 'undefined' ? window.location.hash : '', + query + }) + } catch (logErr) {} const payload = resolveSsoPayload(query || {}) const ssoUser = resolveSsoUser(payload) const redirect = resolveRedirect(query || {}) diff --git a/frontend/src/pages/index/index.vue b/frontend/src/pages/index/index.vue index 2513c5a..8df925b 100644 --- a/frontend/src/pages/index/index.vue +++ b/frontend/src/pages/index/index.vue @@ -1,11 +1,11 @@ -