refactor(frontend): 重构前端第二版
This commit is contained in:
1 parent
2631f78b00
commit
4b562cfa82
205 files changed
+15399
-12015
No files matched your search
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
/**
|
||||
* features/auth/api/user.api.ts
|
||||
* 用户域 HTTP API:资料、请假、密码重置、Agent 列表等。
|
||||
*/
|
||||
import { getAuthHeaders } from '@/utils/auth';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/auth/components/LoginModals.vue
|
||||
* 登录相关弹窗:找回密码、公告详情、企微登录/绑定提示、注册。
|
||||
@@ -6,7 +6,7 @@
|
||||
import { inject } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Lock, User, X } from 'lucide-vue-next';
|
||||
import { formatWecomFieldLabel } from '@/utils/wecom';
|
||||
import { formatWecomFieldLabel } from '@/shared/utils/wecom';
|
||||
import { LOGIN_KEY } from '../composables/login.context';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
/**
|
||||
* features/auth/composables/login.deps.ts
|
||||
* 登录页 composables 共享依赖(i18n、路由、主题、消息等)。
|
||||
*/
|
||||
import type { ComputedRef, WritableComputedRef } from 'vue';
|
||||
import type { ComposerTranslation } from 'vue-i18n';
|
||||
import type { RouteLocationNormalizedLoaded, Router } from 'vue-router';
|
||||
import type { useMessage } from '@/composables/useMessage';
|
||||
import type { ThemePreference } from '@/composables/useTheme';
|
||||
import type { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { ThemePreference } from '@/shared/composables/useTheme';
|
||||
|
||||
export interface LoginDeps {
|
||||
t: ComposerTranslation;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/auth/composables/useLogin.ts
|
||||
* 登录页编排层:组合认证、公告展示与 OAuth 回调,provide 给 LoginView 子组件。
|
||||
*/
|
||||
@@ -6,8 +6,8 @@ import { onMounted, reactive } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { config } from '@/config';
|
||||
import { useTheme } from '@/composables/useTheme';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
import { useTheme } from '@/shared/composables/useTheme';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import loginBg from '@/assets/login-bg.png';
|
||||
import { DEFAULT_POST_LOGIN_AGENT_ID } from '@/features/workspace/types/workspace.types';
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
/**
|
||||
* features/auth/composables/useLoginAuth.ts
|
||||
* 登录表单、企微/Casdoor OAuth 回调、注册与找回密码逻辑。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { config } from '@/config';
|
||||
import { resolveCasdoorErrorMessage } from '@/utils/casdoor';
|
||||
import { resolveCasdoorErrorMessage } from '@/shared/utils/casdoor';
|
||||
import {
|
||||
buildWecomLoginDialogContent,
|
||||
normalizeWecomMatchRules,
|
||||
type WecomMatchField,
|
||||
} from '@/utils/wecom';
|
||||
import { saveAuthUser } from '@/utils/auth';
|
||||
import { BusinessError, requestJson } from '@/api/client';
|
||||
} from '@/shared/utils/wecom';
|
||||
import { saveAuthUser } from '@/shared/utils/auth';
|
||||
import { BusinessError, requestJson } from '@/shared/api/client';
|
||||
import { DEFAULT_POST_LOGIN_AGENT_ID } from '@/features/workspace/types/workspace.types';
|
||||
import type { WecomBindPromptState, WecomLoginDialogContent } from '@/features/workspace/types/workspace.types';
|
||||
import type { LoginDeps } from './login.deps';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
/**
|
||||
* features/auth/composables/useLoginLanding.ts
|
||||
* 登录页营销区:公告列表、公开 Agent 与公告弹窗状态。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { requestJson } from '@/api/client';
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
import type { WorkspaceAgent, WorkspaceAnnouncement } from '@/features/workspace/types/workspace.types';
|
||||
|
||||
export function useLoginLanding() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/auth/stores/auth.store.ts
|
||||
* 认证全局状态;Phase 0 仍委托 utils/auth 读写 storage。
|
||||
*/
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
saveAuthUser,
|
||||
logoutAuth as logoutAuthStorage,
|
||||
refreshAccessToken as refreshAccessTokenStorage,
|
||||
} from '@/utils/auth';
|
||||
} from '@/shared/utils/auth';
|
||||
|
||||
export interface AuthUser {
|
||||
id?: number;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/auth/views/LoginView.vue
|
||||
* 登录页路由入口:MarketingShell + useLogin provide + LoginPage/LoginModals。
|
||||
*/
|
||||
import { provide } from 'vue';
|
||||
import ThemeToggleButton from '@/components/ThemeToggleButton.vue';
|
||||
import LocaleToggleButton from '@/components/LocaleToggleButton.vue';
|
||||
import MarketingShell from '@/layouts/MarketingShell.vue';
|
||||
import ThemeToggleButton from '@/shared/components/ThemeToggleButton.vue';
|
||||
import LocaleToggleButton from '@/shared/components/LocaleToggleButton.vue';
|
||||
import MarketingShell from '@/shared/layouts/MarketingShell.vue';
|
||||
import LoginPage from '../components/LoginPage.vue';
|
||||
import LoginModals from '../components/LoginModals.vue';
|
||||
import { useLogin } from '../composables/useLogin';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/auth/views/ResetPasswordView.vue
|
||||
* 邮件链接重置密码页(/reset-password?token=...)。
|
||||
@@ -6,7 +6,7 @@
|
||||
import { ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { Lock, AlertCircle, CheckCircle } from 'lucide-vue-next';
|
||||
import MinimalShell from '@/layouts/MinimalShell.vue';
|
||||
import MinimalShell from '@/shared/layouts/MinimalShell.vue';
|
||||
import { resetPasswordConfirm } from '@/features/auth/api/user.api';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
Reference in new issue
Block a user