Skip to content

Commit 8ad127c

Browse files
committed
fix: add route base close #404
1 parent 8fb0396 commit 8ad127c

File tree

12 files changed

+30
-51
lines changed

12 files changed

+30
-51
lines changed

build/tsconfig.json

-17
This file was deleted.

build/typeing.d.ts

-6
This file was deleted.

build/utils.ts

-15
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@ export function isReportMode(): boolean {
1717
return process.env.REPORT === 'true';
1818
}
1919

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-
3520
// Read all environment variable configuration files to process.env
3621
export function wrapperEnv(envConf: Recordable): ViteEnv {
3722
const ret: any = {};

build/vite/plugin/html.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* https://github.com/anncwb/vite-plugin-html
44
*/
55
import type { Plugin } from 'vite';
6-
import type { ViteEnv } from '../../utils';
76

87
import html from 'vite-plugin-html';
98

build/vite/plugin/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Plugin } from 'vite';
2-
import type { ViteEnv } from '../../utils';
32

43
import vue from '@vitejs/plugin-vue';
54
import vueJsx from '@vitejs/plugin-vue-jsx';

build/vite/plugin/pwa.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Zero-config PWA for Vite
33
* https://github.com/antfu/vite-plugin-pwa
44
*/
5-
import type { ViteEnv } from '../../utils';
65

76
import { VitePWA } from 'vite-plugin-pwa';
87

mock/_util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Interface data format used to return a unified format
22

3-
export function resultSuccess<T = any>(result: T, { message = 'ok' } = {}) {
3+
export function resultSuccess<T = Recordable>(result: T, { message = 'ok' } = {}) {
44
return {
55
code: 0,
66
result,

src/router/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const WHITE_NAME_LIST = [LoginRoute.name, REDIRECT_NAME];
99

1010
// app router
1111
const router = createRouter({
12-
history: createWebHashHistory(),
12+
history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH),
1313
routes: (basicRoutes as unknown) as RouteRecordRaw[],
1414
strict: true,
1515
scrollBehavior: () => ({ left: 0, top: 0 }),

src/settings/projectSetting.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const setting: ProjectConfig = {
2020
settingButtonPosition: SettingButtonPositionEnum.AUTO,
2121

2222
// Permission mode
23-
permissionMode: PermissionModeEnum.BACK,
23+
permissionMode: PermissionModeEnum.ROLE,
2424

2525
// Permission-related cache is stored in sessionStorage or localStorage
2626
permissionCacheType: CacheTypeEnum.LOCAL,

tsconfig.json

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
"src/**/*.vue",
3535
"types/**/*.d.ts",
3636
"types/**/*.ts",
37+
"build/**/*.ts",
38+
"build/**/*.d.ts",
3739
"mock/**/*.ts"
3840
],
3941
"exclude": ["node_modules", "dist", "**/*.js"]

types/event.d.ts

-7
This file was deleted.

types/global.d.ts

+25
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,28 @@ declare type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElR
6161
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
6262

6363
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+
}

0 commit comments

Comments
 (0)