fix(auth): 重构登录认证,并支持跳转到关联服务如图纸标注
This commit is contained in:
1 parent
ce1fd59f61
commit
affe139bf9
51 files changed
+1939
-132
No files matched your search
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/auth/composables/useLogin.ts
|
||||
* 登录页编排层:组合认证、公告展示与 OAuth 回调,provide 给 LoginView 子组件。
|
||||
* 依赖:auth.store、linked-nav.store、useLoginAuth、useLoginLanding。
|
||||
* 逻辑:登录成功后预取关联服务侧栏入口,减少进入 Chat/工作台后的入口闪现。
|
||||
*/
|
||||
import { onMounted, reactive } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
@@ -13,6 +15,7 @@ import loginBg from '@/assets/login-bg.png';
|
||||
import { DEFAULT_POST_LOGIN_AGENT_ID } from '@/features/workspace/types/workspace.types';
|
||||
import { useWorkspaceLocale } from '@/features/workspace/composables/useWorkspaceLocale';
|
||||
import { continuationLocation, readSsoContinuation } from '@/features/sso';
|
||||
import { useLinkedNavStore } from '@/features/sso/stores/linked-nav.store';
|
||||
import { useLoginAuth } from './useLoginAuth';
|
||||
import { useLoginLanding } from './useLoginLanding';
|
||||
|
||||
@@ -22,6 +25,7 @@ export function useLogin() {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const authStore = useAuthStore();
|
||||
const linkedNav = useLinkedNavStore();
|
||||
const { setThemePreference, appliedTheme } = useTheme();
|
||||
|
||||
const deps = { t, locale, msg, router, route, setThemePreference, appliedTheme };
|
||||
@@ -29,6 +33,7 @@ export function useLogin() {
|
||||
|
||||
const completePasswordLogin = async () => {
|
||||
authStore.syncFromStorage();
|
||||
void linkedNav.ensureLoaded({ force: true });
|
||||
const continuation = readSsoContinuation();
|
||||
if (continuation) {
|
||||
await router.replace(continuationLocation(continuation));
|
||||
@@ -39,6 +44,7 @@ export function useLogin() {
|
||||
|
||||
const completeOAuthLogin = async () => {
|
||||
authStore.syncFromStorage();
|
||||
void linkedNav.ensureLoaded({ force: true });
|
||||
const continuation = readSsoContinuation();
|
||||
if (continuation) {
|
||||
await router.replace(continuationLocation(continuation));
|
||||
|
||||
Reference in new issue
Block a user