This commit is contained in:
ahjung
2024-09-14 22:39:11 +08:00
parent 1ae5372396
commit 7a62de39c2
62 changed files with 1996 additions and 2938 deletions

19
types/config.d.ts vendored
View File

@@ -52,8 +52,9 @@ export interface GlobConfig {
shortName: string;
urlPrefix?: string;
uploadUrl?: string;
prodMock: boolean;
imgUrl?: string;
useMock: boolean;
fileUrl?: string;
loggerMock: boolean;
}
export interface GlobEnvConfig {
@@ -63,12 +64,14 @@ export interface GlobEnvConfig {
VITE_GLOB_API_URL: string;
// 接口前缀
VITE_GLOB_API_URL_PREFIX?: string;
// Project abbreviation
// 网站别名
VITE_GLOB_APP_SHORT_NAME: string;
// 图片上传地址
// 文件上传地址
VITE_GLOB_UPLOAD_URL?: string;
//图片前缀地址
VITE_GLOB_IMG_URL?: string;
//生产环境开启mock
VITE_GLOB_PROD_MOCK: boolean;
// 文件前缀地址
VITE_GLOB_FILE_URL?: string;
// 开启 mock
VITE_USE_MOCK: boolean;
// 是否开启控制台打印 mock 请求信息
VITE_LOGGER_MOCK: boolean;
}

6
types/global.d.ts vendored
View File

@@ -30,6 +30,12 @@ declare global {
-readonly [P in keyof T]: T[P];
};
declare interface InResult<T = any> {
code: number;
message: string;
result: T;
}
declare type Nullable<T> = T | null;
declare type NonNullable<T> = T extends null | undefined ? never : T;
declare type Recordable<T = any> = Record<string, T>;

7
types/images.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
declare module '*.svg';
declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.gif';
declare module '*.bmp';
declare module '*.tiff';