diff --git a/build/tsconfig.json b/build/tsconfig.json deleted file mode 100644 index 1ffedd0e..00000000 --- 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 3f221c7c..00000000 --- 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 d5e95e3c..a3059f66 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 6612dc8f..dec546cd 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 d34cf049..afd71f22 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 3d62faa2..f5ab5ed7 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 c59be9d8..0c15b154 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 679149d2..75b06820 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 22dc84ff..eca9e05f 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 43828529..c3ae39d7 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 67b3e293..00000000 --- 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 bce07851..87377e01 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; +}