fix: 修复build警告循环依赖问题

This commit is contained in:
landaiqing
2024-04-27 22:27:58 +08:00
parent ede25b7bfe
commit edcff9a7c7
3 changed files with 235 additions and 229 deletions

View File

@@ -19,7 +19,7 @@ export class useUserStore {
storage: window.localStorage, // 保存的位置看自己的业务情况选择可以是localStoragesessionstorage storage: window.localStorage, // 保存的位置看自己的业务情况选择可以是localStoragesessionstorage
// 。。还有一些其他配置参数例如数据过期时间等等可以康康文档像storage这种字段可以配置在全局配置里详见文档 // 。。还有一些其他配置参数例如数据过期时间等等可以康康文档像storage这种字段可以配置在全局配置里详见文档
}).then( }).then(
action((persistStore) => { action(() => {
// persist 完成的回调在这里可以执行一些拿到数据后需要执行的操作如果在页面上要判断是否完成persist使用 isHydrated // persist 完成的回调在这里可以执行一些拿到数据后需要执行的操作如果在页面上要判断是否完成persist使用 isHydrated
// console.log(persistStore) // console.log(persistStore)
}), }),

View File

@@ -2,127 +2,127 @@
/* eslint-disable */ /* eslint-disable */
declare namespace API { declare namespace API {
type ApiResponse<T> = { // type ApiResponse<T> = {
success?: boolean; // success?: boolean;
code?: number; // code?: number;
codeMessage?: string; // codeMessage?: string;
errorMessage?: Map<string, string>; // errorMessage?: Map<string, string>;
showType?: ErrorShowType; // showType?: ErrorShowType;
data: T // data: T
} // }
type CurrentUser = { // type CurrentUser = {
name?: string; // name?: string;
avatar?: string; // avatar?: string;
userid?: string; // userid?: string;
email?: string; // email?: string;
signature?: string; // signature?: string;
title?: string; // title?: string;
group?: string; // group?: string;
tags?: { key?: string; label?: string }[]; // tags?: { key?: string; label?: string }[];
notifyCount?: number; // notifyCount?: number;
unreadCount?: number; // unreadCount?: number;
country?: string; // country?: string;
access?: string; // access?: string;
geographic?: { // geographic?: {
province?: { label?: string; key?: string }; // province?: { label?: string; key?: string };
city?: { label?: string; key?: string }; // city?: { label?: string; key?: string };
}; // };
address?: string; // address?: string;
phone?: string; // phone?: string;
}; // };
//
// type LoginResult = ResponseStructure & {
// data?: {
// token?: string;
// expireDateTime?: number;
// expire?: number;
// timeUnit?: any;
// }
// };
//
// type PageParams = {
// pageNum?: number;
// pageSize?: number;
// };
type LoginResult = ResponseStructure & { // type RuleListItem = {
data?: { // key?: number;
token?: string; // disabled?: boolean;
expireDateTime?: number; // href?: string;
expire?: number; // avatar?: string;
timeUnit?: any; // name?: string;
} // owner?: string;
}; // desc?: string;
// callNo?: number;
// status?: number;
// updatedAt?: string;
// createdAt?: string;
// progress?: number;
// };
type PageParams = { // type RuleList = {
pageNum?: number; // data?: RuleListItem[];
pageSize?: number; // /** 列表的内容总数 */
}; // total?: number;
// success?: boolean;
// };
// interface ResponseStructure {
// success?: boolean;
// code?: number;
// codeMessage?: string;
// errorMessage?: Map<string, string>;
// showType?: ErrorShowType;
// }
// type
// FakeCaptcha = ResponseStructure & {
// data?: boolean,
// };
//
// type PhonePasswordLoginParams = {
// clientId?: string;
// phone?: string;
// password?: string;
// code?: string;
// autoLogin?: boolean;
// };
//
// type PhoneSmsCodeLoginParams = {
// clientId?: string;
// phone?: string;
// smsCode?: string;
// autoLogin?: boolean;
// };
//
// type ErrorResponse = {
// /** 业务约定的错误码 */
// errorCode: string;
// /** 业务上的错误信息 */
// errorMessage?: Map<string, string>;
// /** 业务上的请求是否成功 */
// success?: boolean;
// };
//
// type NoticeIconList = {
// data?: NoticeIconItem[];
// /** 列表的内容总数 */
// total?: number;
// success?: boolean;
// };
type RuleListItem = { // type NoticeIconItemType = 'notification' | 'message' | 'event';
key?: number;
disabled?: boolean;
href?: string;
avatar?: string;
name?: string;
owner?: string;
desc?: string;
callNo?: number;
status?: number;
updatedAt?: string;
createdAt?: string;
progress?: number;
};
type RuleList = { // type NoticeIconItem = {
data?: RuleListItem[]; // id?: string;
/** 列表的内容总数 */ // extra?: string;
total?: number; // key?: string;
success?: boolean; // read?: boolean;
}; // avatar?: string;
interface ResponseStructure { // title?: string;
success?: boolean; // status?: string;
code?: number; // datetime?: string;
codeMessage?: string; // description?: string;
errorMessage?: Map<string, string>; // type?: NoticeIconItemType;
showType?: ErrorShowType; // };
}
type
FakeCaptcha = ResponseStructure & {
data?: boolean,
};
type PhonePasswordLoginParams = {
clientId?: string;
phone?: string;
password?: string;
code?: string;
autoLogin?: boolean;
};
type PhoneSmsCodeLoginParams = {
clientId?: string;
phone?: string;
smsCode?: string;
autoLogin?: boolean;
};
type ErrorResponse = {
/** 业务约定的错误码 */
errorCode: string;
/** 业务上的错误信息 */
errorMessage?: Map<string, string>;
/** 业务上的请求是否成功 */
success?: boolean;
};
type NoticeIconList = {
data?: NoticeIconItem[];
/** 列表的内容总数 */
total?: number;
success?: boolean;
};
type NoticeIconItemType = 'notification' | 'message' | 'event';
type NoticeIconItem = {
id?: string;
extra?: string;
key?: string;
read?: boolean;
avatar?: string;
title?: string;
status?: string;
datetime?: string;
description?: string;
type?: NoticeIconItemType;
};
type GenerateMpRegCode = { type GenerateMpRegCode = {
data?: { data?: {
@@ -134,21 +134,21 @@ declare namespace API {
}; };
} }
type GetClientId = { // type GetClientId = {
data?: string; // data?: string;
} // }
type GenerateBase64Code = { type GenerateBase64Code = {
data?: string; data?: string;
} }
type GetClientToken = { // type GetClientToken = {
data?: { // data?: {
token?: string; // token?: string;
expireDateTime?: number; // expireDateTime?: number;
expire?: number; // expire?: number;
}; // };
} // }
type PhoneRegisterRequest = { type PhoneRegisterRequest = {
clientId?: string; clientId?: string;
@@ -158,85 +158,85 @@ declare namespace API {
smsCode?: number; smsCode?: number;
} }
type PhoneRegisterResponse = ResponseStructure & { // type PhoneRegisterResponse = ResponseStructure & {
data?: number; // data?: number;
} // }
//
type CustomValidate = { // type CustomValidate = {
validateStatus?: boolean; // validateStatus?: boolean;
msg?: string; // msg?: string;
formValue?: any; // formValue?: any;
code?: number; // code?: number;
codeMessage?: string; // codeMessage?: string;
errors?: Map<string, string>; // errors?: Map<string, string>;
validateFields: ValidateFields<Values>; // validateFields: ValidateFields<Values>;
} // }
//
type ListAccountBookVo = ResponseStructure & { // type ListAccountBookVo = ResponseStructure & {
data?: { // data?: {
total?: number; // total?: number;
list?: ListAccountBookVoItem[] // list?: ListAccountBookVoItem[]
} // }
} // }
type ListAccountBookVoItem = { // type ListAccountBookVoItem = {
id: number; // id: number;
companyName?: string; // companyName?: string;
valueAddedTaxCate?: string; // valueAddedTaxCate?: string;
accountingStandard?: string; // accountingStandard?: string;
startTime?: Date; // startTime?: Date;
createTime?: Date; // createTime?: Date;
enableVoucherVerify?: boolean; // enableVoucherVerify?: boolean;
disable?: boolean; // disable?: boolean;
} // }
type GetAccountBookVo = { // type GetAccountBookVo = {
id?: number; // id?: number;
companyName?: string; // companyName?: string;
unifiedSocialCreditCode?: string; // unifiedSocialCreditCode?: string;
industryId?: number; // industryId?: number;
valueAddedTaxCate?: number; // valueAddedTaxCate?: number;
enableVoucherVerify?: boolean; // enableVoucherVerify?: boolean;
startTime?: Date; // startTime?: Date;
accountingStandard?: number; // accountingStandard?: number;
enableFixedAssets?: boolean; // enableFixedAssets?: boolean;
enableCapital?: boolean; // enableCapital?: boolean;
enablePsi?: boolean; // enablePsi?: boolean;
} // }
type DataDictionaryVo = { // type DataDictionaryVo = {
dataCode?: string; // dataCode?: string;
dataValue?: string; // dataValue?: string;
} // }
//
type ListTreeMenuVo = { // type ListTreeMenuVo = {
id?: number; // id?: number;
key?: string; // key?: string;
title?: any; // title?: any;
icon?: string; // icon?: string;
checked?: boolean; // checked?: boolean;
children?: ListTreeMenuVo[]; // children?: ListTreeMenuVo[];
level?: number; // level?: number;
}; // };
//
type ListTreeSelectMenuVo = { // type ListTreeSelectMenuVo = {
id?: number; // id?: number;
value?: string; // value?: string;
title?: any; // title?: any;
children?: ListTreeMenuVo[]; // children?: ListTreeMenuVo[];
} // }
//
type ListRoleVo = { // type ListRoleVo = {
id: number; // id: number;
roleName?: string; // roleName?: string;
disable?: boolean; // disable?: boolean;
} // }
//
type ListSubject = { // type ListSubject = {
id: number; // id: number;
pid?: number; // pid?: number;
valueAddedTaxCate?: string; // valueAddedTaxCate?: string;
accountingStandard?: string; // accountingStandard?: string;
startTime?: Date; // startTime?: Date;
createTime?: Date; // createTime?: Date;
enableVoucherVerify?: boolean; // enableVoucherVerify?: boolean;
disable?: boolean; // disable?: boolean;
} // }
} }

View File

@@ -16,6 +16,7 @@ import autoprefixer from 'autoprefixer'
export default defineConfig(({ mode }) => { export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd()) const env = loadEnv(mode, process.cwd())
return { return {
base: '/',
plugins: [ plugins: [
react(), react(),
legacy({ legacy({
@@ -94,22 +95,22 @@ export default defineConfig(({ mode }) => {
modules: { modules: {
// 一般我们可以通过 generateScopedName 属性来对生成的类名进行自定义 // 一般我们可以通过 generateScopedName 属性来对生成的类名进行自定义
// 其中name 表示当前文件名local 表示类名 // 其中name 表示当前文件名local 表示类名
generateScopedName: "[name]__[local]___[hash:base64:5]" generateScopedName: '[name]__[local]___[hash:base64:5]',
}, },
postcss:{ postcss: {
plugins:[ plugins: [
postcssPresetEnv(), postcssPresetEnv(),
autoprefixer({ // 自动添加前缀 autoprefixer({
// 自动添加前缀
overrideBrowserslist: [ overrideBrowserslist: [
"Android 4.1", 'Android 4.1',
"iOS 7.1", 'iOS 7.1',
"Chrome > 31", 'Chrome > 31',
"ff > 31", 'ff > 31',
"ie >= 8" 'ie >= 8',
],
}),
], ],
})
]
}, },
preprocessorOptions: { preprocessorOptions: {
less: { less: {
@@ -150,6 +151,11 @@ export default defineConfig(({ mode }) => {
chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称 chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称
entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称 entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称
assetFileNames: '[ext]/[name]-[hash].[ext]', // 资源文件像 字体,图片等 assetFileNames: '[ext]/[name]-[hash].[ext]', // 资源文件像 字体,图片等
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString()
}
},
}, },
}, },
}, },