diff --git a/build/tsconfig.json b/build/tsconfig.json deleted file mode 100644 index 1ffedd0e5176ff623938aff0717d515c358f0d46..0000000000000000000000000000000000000000 --- a/build/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "commonjs", - "moduleResolution": "node", - "strict": true, - "forceConsistentCasingInFileNames": true, - "baseUrl": ".", - "esModuleInterop": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "experimentalDecorators": true, - "lib": ["dom", "esnext"], - "incremental": true, - "skipLibCheck": true - } -} diff --git a/build/typeing.d.ts b/build/typeing.d.ts deleted file mode 100644 index 3f221c7cc3ba7c89a5edfc0dc0215827c6727f7d..0000000000000000000000000000000000000000 --- a/build/typeing.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const src: any; - export default src; -} - -declare type Recordable = Record; diff --git a/build/utils.ts b/build/utils.ts index d5e95e3c166738d52e7bf36d1b7b934dd911e1ed..a3059f6699036fbbed00e3a66b498493820cc2e2 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -17,21 +17,6 @@ export function isReportMode(): boolean { return process.env.REPORT === 'true'; } -export interface ViteEnv { - VITE_PORT: number; - VITE_USE_MOCK: boolean; - VITE_USE_PWA: boolean; - VITE_PUBLIC_PATH: string; - VITE_PROXY: [string, string][]; - VITE_GLOB_APP_TITLE: string; - VITE_GLOB_APP_SHORT_NAME: string; - VITE_USE_CDN: boolean; - VITE_DROP_CONSOLE: boolean; - VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none'; - VITE_LEGACY: boolean; - VITE_USE_IMAGEMIN: boolean; -} - // Read all environment variable configuration files to process.env export function wrapperEnv(envConf: Recordable): ViteEnv { const ret: any = {}; diff --git a/build/vite/plugin/html.ts b/build/vite/plugin/html.ts index 6612dc8fbdc342c41f60596642b60299329bfba6..dec546cd723179bca1373f982728b428635c6bd4 100644 --- a/build/vite/plugin/html.ts +++ b/build/vite/plugin/html.ts @@ -3,7 +3,6 @@ * https://github.com/anncwb/vite-plugin-html */ import type { Plugin } from 'vite'; -import type { ViteEnv } from '../../utils'; import html from 'vite-plugin-html'; diff --git a/build/vite/plugin/index.ts b/build/vite/plugin/index.ts index d34cf049c9f246230a2259cc91d73dc26e05250b..afd71f226c734818d8a5d19665313344c7bbdb45 100644 --- a/build/vite/plugin/index.ts +++ b/build/vite/plugin/index.ts @@ -1,5 +1,4 @@ import type { Plugin } from 'vite'; -import type { ViteEnv } from '../../utils'; import vue from '@vitejs/plugin-vue'; import vueJsx from '@vitejs/plugin-vue-jsx'; diff --git a/build/vite/plugin/pwa.ts b/build/vite/plugin/pwa.ts index 3d62faa272db83c172b837fed55fc680691c5575..f5ab5ed799b00c36edc52cd74e2874a3f8c4c23c 100644 --- a/build/vite/plugin/pwa.ts +++ b/build/vite/plugin/pwa.ts @@ -2,7 +2,6 @@ * Zero-config PWA for Vite * https://github.com/antfu/vite-plugin-pwa */ -import type { ViteEnv } from '../../utils'; import { VitePWA } from 'vite-plugin-pwa'; diff --git a/mock/_util.ts b/mock/_util.ts index c59be9d81807f4e89729c3825281888abd58d0b1..0c15b1544275ff40d8e7b506e94446a24f6bebaa 100644 --- a/mock/_util.ts +++ b/mock/_util.ts @@ -1,6 +1,6 @@ // Interface data format used to return a unified format -export function resultSuccess(result: T, { message = 'ok' } = {}) { +export function resultSuccess(result: T, { message = 'ok' } = {}) { return { code: 0, result, diff --git a/src/router/index.ts b/src/router/index.ts index 679149d233fab03ce0b9afc919f32c70062900c9..75b06820ab3b4edea4f7f4144e26cd4979feba70 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -9,7 +9,7 @@ const WHITE_NAME_LIST = [LoginRoute.name, REDIRECT_NAME]; // app router const router = createRouter({ - history: createWebHashHistory(), + history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH), routes: (basicRoutes as unknown) as RouteRecordRaw[], strict: true, scrollBehavior: () => ({ left: 0, top: 0 }), diff --git a/src/settings/projectSetting.ts b/src/settings/projectSetting.ts index 22dc84ff3ff57ff1fdc7c1468316b6eb310c1d58..eca9e05fa46029380f6ef336b258705111c4cfa7 100644 --- a/src/settings/projectSetting.ts +++ b/src/settings/projectSetting.ts @@ -20,7 +20,7 @@ const setting: ProjectConfig = { settingButtonPosition: SettingButtonPositionEnum.AUTO, // Permission mode - permissionMode: PermissionModeEnum.BACK, + permissionMode: PermissionModeEnum.ROLE, // Permission-related cache is stored in sessionStorage or localStorage permissionCacheType: CacheTypeEnum.LOCAL, diff --git a/tsconfig.json b/tsconfig.json index 43828529570f2d7f39de21bbd813698ebeb2ecd2..c3ae39d780bdc1c2a3881ccc41e4985773e43cc6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,6 +34,8 @@ "src/**/*.vue", "types/**/*.d.ts", "types/**/*.ts", + "build/**/*.ts", + "build/**/*.d.ts", "mock/**/*.ts" ], "exclude": ["node_modules", "dist", "**/*.js"] diff --git a/types/event.d.ts b/types/event.d.ts deleted file mode 100644 index 67b3e2931a5bf682f59683d85ff6c9c69355e58f..0000000000000000000000000000000000000000 --- a/types/event.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare interface ChangeEvent extends Event { - target: HTMLInputElement; -} - -declare interface WheelEvent { - path?: EventTarget[]; -} diff --git a/types/global.d.ts b/types/global.d.ts index bce0785130ddeab4594ca91fe8bd5c851f3952b0..87377e01a50a13b6918c41da93e17b9726e7f78d 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -61,3 +61,28 @@ declare type ComponentRef = ComponentElR declare type ElRef = Nullable; type IsSame = A | B extends A & B ? true : false; + +declare interface ChangeEvent extends Event { + target: HTMLInputElement; +} + +declare interface WheelEvent { + path?: EventTarget[]; +} + +type ImportMetaEnv = ViteEnv; + +declare interface ViteEnv { + VITE_PORT: number; + VITE_USE_MOCK: boolean; + VITE_USE_PWA: boolean; + VITE_PUBLIC_PATH: string; + VITE_PROXY: [string, string][]; + VITE_GLOB_APP_TITLE: string; + VITE_GLOB_APP_SHORT_NAME: string; + VITE_USE_CDN: boolean; + VITE_DROP_CONSOLE: boolean; + VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none'; + VITE_LEGACY: boolean; + VITE_USE_IMAGEMIN: boolean; +}