Commit 8ad127c293872aa10db03044bbc68715dc1b804a

Authored by Vben
1 parent 8fb03961

fix: add route base close #404

build/tsconfig.json deleted 100644 โ†’ 0
1   -{
2   - "compilerOptions": {
3   - "target": "esnext",
4   - "module": "commonjs",
5   - "moduleResolution": "node",
6   - "strict": true,
7   - "forceConsistentCasingInFileNames": true,
8   - "baseUrl": ".",
9   - "esModuleInterop": true,
10   - "noUnusedLocals": true,
11   - "noUnusedParameters": true,
12   - "experimentalDecorators": true,
13   - "lib": ["dom", "esnext"],
14   - "incremental": true,
15   - "skipLibCheck": true
16   - }
17   -}
build/typeing.d.ts deleted 100644 โ†’ 0
1   -declare module '*.json' {
2   - const src: any;
3   - export default src;
4   -}
5   -
6   -declare type Recordable = Record<string, any>;
build/utils.ts
... ... @@ -17,21 +17,6 @@ export function isReportMode(): boolean {
17 17 return process.env.REPORT === 'true';
18 18 }
19 19  
20   -export interface ViteEnv {
21   - VITE_PORT: number;
22   - VITE_USE_MOCK: boolean;
23   - VITE_USE_PWA: boolean;
24   - VITE_PUBLIC_PATH: string;
25   - VITE_PROXY: [string, string][];
26   - VITE_GLOB_APP_TITLE: string;
27   - VITE_GLOB_APP_SHORT_NAME: string;
28   - VITE_USE_CDN: boolean;
29   - VITE_DROP_CONSOLE: boolean;
30   - VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
31   - VITE_LEGACY: boolean;
32   - VITE_USE_IMAGEMIN: boolean;
33   -}
34   -
35 20 // Read all environment variable configuration files to process.env
36 21 export function wrapperEnv(envConf: Recordable): ViteEnv {
37 22 const ret: any = {};
... ...
build/vite/plugin/html.ts
... ... @@ -3,7 +3,6 @@
3 3 * https://github.com/anncwb/vite-plugin-html
4 4 */
5 5 import type { Plugin } from 'vite';
6   -import type { ViteEnv } from '../../utils';
7 6  
8 7 import html from 'vite-plugin-html';
9 8  
... ...
build/vite/plugin/index.ts
1 1 import type { Plugin } from 'vite';
2   -import type { ViteEnv } from '../../utils';
3 2  
4 3 import vue from '@vitejs/plugin-vue';
5 4 import vueJsx from '@vitejs/plugin-vue-jsx';
... ...
build/vite/plugin/pwa.ts
... ... @@ -2,7 +2,6 @@
2 2 * Zero-config PWA for Vite
3 3 * https://github.com/antfu/vite-plugin-pwa
4 4 */
5   -import type { ViteEnv } from '../../utils';
6 5  
7 6 import { VitePWA } from 'vite-plugin-pwa';
8 7  
... ...
mock/_util.ts
1 1 // Interface data format used to return a unified format
2 2  
3   -export function resultSuccess<T = any>(result: T, { message = 'ok' } = {}) {
  3 +export function resultSuccess<T = Recordable>(result: T, { message = 'ok' } = {}) {
4 4 return {
5 5 code: 0,
6 6 result,
... ...
src/router/index.ts
... ... @@ -9,7 +9,7 @@ const WHITE_NAME_LIST = [LoginRoute.name, REDIRECT_NAME];
9 9  
10 10 // app router
11 11 const router = createRouter({
12   - history: createWebHashHistory(),
  12 + history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH),
13 13 routes: (basicRoutes as unknown) as RouteRecordRaw[],
14 14 strict: true,
15 15 scrollBehavior: () => ({ left: 0, top: 0 }),
... ...
src/settings/projectSetting.ts
... ... @@ -20,7 +20,7 @@ const setting: ProjectConfig = {
20 20 settingButtonPosition: SettingButtonPositionEnum.AUTO,
21 21  
22 22 // Permission mode
23   - permissionMode: PermissionModeEnum.BACK,
  23 + permissionMode: PermissionModeEnum.ROLE,
24 24  
25 25 // Permission-related cache is stored in sessionStorage or localStorage
26 26 permissionCacheType: CacheTypeEnum.LOCAL,
... ...
tsconfig.json
... ... @@ -34,6 +34,8 @@
34 34 "src/**/*.vue",
35 35 "types/**/*.d.ts",
36 36 "types/**/*.ts",
  37 + "build/**/*.ts",
  38 + "build/**/*.d.ts",
37 39 "mock/**/*.ts"
38 40 ],
39 41 "exclude": ["node_modules", "dist", "**/*.js"]
... ...
types/event.d.ts deleted 100644 โ†’ 0
1   -declare interface ChangeEvent extends Event {
2   - target: HTMLInputElement;
3   -}
4   -
5   -declare interface WheelEvent {
6   - path?: EventTarget[];
7   -}
types/global.d.ts
... ... @@ -61,3 +61,28 @@ declare type ComponentRef&lt;T extends HTMLElement = HTMLDivElement&gt; = ComponentElR
61 61 declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
62 62  
63 63 type IsSame<A, B> = A | B extends A & B ? true : false;
  64 +
  65 +declare interface ChangeEvent extends Event {
  66 + target: HTMLInputElement;
  67 +}
  68 +
  69 +declare interface WheelEvent {
  70 + path?: EventTarget[];
  71 +}
  72 +
  73 +type ImportMetaEnv = ViteEnv;
  74 +
  75 +declare interface ViteEnv {
  76 + VITE_PORT: number;
  77 + VITE_USE_MOCK: boolean;
  78 + VITE_USE_PWA: boolean;
  79 + VITE_PUBLIC_PATH: string;
  80 + VITE_PROXY: [string, string][];
  81 + VITE_GLOB_APP_TITLE: string;
  82 + VITE_GLOB_APP_SHORT_NAME: string;
  83 + VITE_USE_CDN: boolean;
  84 + VITE_DROP_CONSOLE: boolean;
  85 + VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
  86 + VITE_LEGACY: boolean;
  87 + VITE_USE_IMAGEMIN: boolean;
  88 +}
... ...