视频会议
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<!--
|
||||
<!--
|
||||
启动页 / 路由分发页
|
||||
|
||||
|
||||
功能:
|
||||
- 判断用户登录状态(检查本地 Token)
|
||||
- 已登录 → 跳转消息列表页(TabBar 首页)
|
||||
- 未登录 → 跳转登录页
|
||||
|
||||
|
||||
此页面不展示 UI,仅作为路由分发入口
|
||||
-->
|
||||
<template>
|
||||
@@ -23,9 +23,30 @@
|
||||
*/
|
||||
import { useUserStore } from '@/store/user'
|
||||
|
||||
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 ''
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'LaunchPage',
|
||||
onLoad() {
|
||||
const ssoQuery = readSsoQueryFromLocation()
|
||||
if (ssoQuery) {
|
||||
console.warn('[Index] detected SSO params on launch page, redirect to SSO')
|
||||
uni.redirectTo({ url: `/pages/auth/sso?${ssoQuery}` })
|
||||
return
|
||||
}
|
||||
const store = useUserStore()
|
||||
if (store.isLoggedIn) {
|
||||
uni.switchTab({ url: '/pages/chat/index' })
|
||||
@@ -50,3 +71,4 @@ export default {
|
||||
color: #94A3B8;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user