From e002e45f82f47e245245f41e66932150d0503068 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 23 Sep 2026 17:39:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E9=94=81?= =?UTF-8?q?=E5=B1=8F=E5=8A=9F=E8=83=BD=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/App.vue | 42 +-- web/src/components/Lockscreen/Lockscreen.vue | 315 ------------------- web/src/components/Lockscreen/Recharge.vue | 164 ---------- web/src/components/Lockscreen/index.ts | 3 - web/src/layout/components/Header/index.vue | 9 - web/src/store/modules/index.ts | 3 - web/src/store/modules/lockscreen.ts | 31 -- web/src/store/modules/user.ts | 2 - web/src/store/mutation-types.ts | 1 - web/src/store/types.ts | 2 - 10 files changed, 1 insertion(+), 571 deletions(-) delete mode 100644 web/src/components/Lockscreen/Lockscreen.vue delete mode 100644 web/src/components/Lockscreen/Recharge.vue delete mode 100644 web/src/components/Lockscreen/index.ts delete mode 100644 web/src/store/modules/lockscreen.ts diff --git a/web/src/App.vue b/web/src/App.vue index d8e9d32..aae22f8 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,6 +1,5 @@ diff --git a/web/src/components/Lockscreen/Recharge.vue b/web/src/components/Lockscreen/Recharge.vue deleted file mode 100644 index 4eef443..0000000 --- a/web/src/components/Lockscreen/Recharge.vue +++ /dev/null @@ -1,164 +0,0 @@ - - - - - diff --git a/web/src/components/Lockscreen/index.ts b/web/src/components/Lockscreen/index.ts deleted file mode 100644 index 7e086dc..0000000 --- a/web/src/components/Lockscreen/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import LockScreen from './Lockscreen.vue'; - -export { LockScreen }; diff --git a/web/src/layout/components/Header/index.vue b/web/src/layout/components/Header/index.vue index 8fd072a..56baf12 100644 --- a/web/src/layout/components/Header/index.vue +++ b/web/src/layout/components/Header/index.vue @@ -216,7 +216,6 @@ } from 'naive-ui'; import { TABS_ROUTES } from '@/store/mutation-types'; import { useUserStore } from '@/store/modules/user'; - import { useLockscreenStore } from '@/store/modules/lockscreen'; import ProjectSetting from './ProjectSetting.vue'; import { AsideMenu } from '@/layout/components/Menu'; import { useProjectSetting } from '@/hooks/setting/useProjectSetting'; @@ -249,7 +248,6 @@ const i18nStore = useI18nStore(); const userStore = useUserStore(); const notificationStore = notificationStoreWidthOut(); - const useLockscreen = useLockscreenStore(); const message = useMessage(); const dialog = useDialog(); const { @@ -396,13 +394,6 @@ icon: 'BellOutlined', tips: '我的消息', }, - { - icon: 'LockOutlined', - tips: '锁屏', - eventObject: { - click: () => useLockscreen.setLock(true), - }, - }, ]; function renderCustomHeader() { diff --git a/web/src/store/modules/index.ts b/web/src/store/modules/index.ts index b1c9dbf..ff19e74 100644 --- a/web/src/store/modules/index.ts +++ b/web/src/store/modules/index.ts @@ -14,8 +14,6 @@ import user from './user'; // @ts-ignore import tabsView from './tabs-view'; // @ts-ignore -import lockscreen from './lockscreen'; -// @ts-ignore import dict from './dict'; // @ts-ignore import i18n from './i18n'; @@ -24,7 +22,6 @@ export default { asyncRoute, user, tabsView, - lockscreen, dict, i18n, }; diff --git a/web/src/store/modules/lockscreen.ts b/web/src/store/modules/lockscreen.ts deleted file mode 100644 index c9bf4a2..0000000 --- a/web/src/store/modules/lockscreen.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { defineStore } from 'pinia'; -import { IS_LOCKSCREEN } from '@/store/mutation-types'; -import { storage } from '@/utils/Storage'; - -// 长时间不操作默认锁屏时间 -const initTime = 60 * 60; - -const isLock = storage.get(IS_LOCKSCREEN, false); - -export type ILockscreenState = { - isLock: boolean; // 是否锁屏 - lockTime: number; -}; - -export const useLockscreenStore = defineStore({ - id: 'app-lockscreen', - state: (): ILockscreenState => ({ - isLock: isLock === true, // 是否锁屏 - lockTime: isLock == 'true' ? initTime : 0, - }), - getters: {}, - actions: { - setLock(payload) { - this.isLock = payload; - storage.set(IS_LOCKSCREEN, this.isLock); - }, - setLockTime(payload = initTime) { - this.lockTime = payload; - }, - }, -}); diff --git a/web/src/store/modules/user.ts b/web/src/store/modules/user.ts index 8742e76..2797609 100644 --- a/web/src/store/modules/user.ts +++ b/web/src/store/modules/user.ts @@ -7,7 +7,6 @@ import { CURRENT_DICT, CURRENT_LOGIN_CONFIG, CURRENT_USER, - IS_LOCKSCREEN, } from '@/store/mutation-types'; import { ResultEnum } from '@/enums/httpEnum'; import { @@ -177,7 +176,6 @@ export const useUserStore = defineStore({ const ex = 30 * 24 * 60 * 60 * 1000; storage.set(ACCESS_TOKEN, data.token, ex); storage.set(CURRENT_USER, data, ex); - storage.set(IS_LOCKSCREEN, false); this.setToken(data.token); this.setUserInfo(data); } diff --git a/web/src/store/mutation-types.ts b/web/src/store/mutation-types.ts index 15d17a2..81fa636 100644 --- a/web/src/store/mutation-types.ts +++ b/web/src/store/mutation-types.ts @@ -2,7 +2,6 @@ export const ACCESS_TOKEN = 'ACCESS-TOKEN'; // 用户token export const CURRENT_USER = 'CURRENT-USER'; // 当前用户信息 export const CURRENT_CONFIG = 'CURRENT-CONFIG'; // 当前基础配置 export const CURRENT_LOGIN_CONFIG = 'CURRENT-LOGIN-CONFIG'; // 当前登录配置 -export const IS_LOCKSCREEN = 'IS-LOCKSCREEN'; // 是否锁屏 export const TABS_ROUTES = 'TABS-ROUTES'; // 标签页 export const CURRENT_DICT = 'CURRENT-DICT'; // 当前用户字典配置 export const CurrentLocale = 'Current-Locale'; // 当前语言 diff --git a/web/src/store/types.ts b/web/src/store/types.ts index 65cef51..482918f 100644 --- a/web/src/store/types.ts +++ b/web/src/store/types.ts @@ -1,6 +1,5 @@ import { IAsyncRouteState } from '@/store/modules/asyncRoute'; import { IUserState } from '@/store/modules/user'; -import { ILockscreenState } from '@/store/modules/lockscreen'; import { ITabsViewState } from '@/store/modules/tabsView'; import { INotificationStore } from '@/store/modules/notification'; import { IDictState } from '@/store/modules/dict'; @@ -8,7 +7,6 @@ import { IDictState } from '@/store/modules/dict'; export interface IStore { asyncRoute: IAsyncRouteState; user: IUserState; - lockscreen: ILockscreenState; tabsView: ITabsViewState; dict: IDictState; notification: INotificationStore;