refactor(projects): 细节优化

This commit is contained in:
Soybean
2022-04-27 22:27:46 +08:00
parent e899914426
commit c275f2632c
10 changed files with 87 additions and 91 deletions

View File

@ -1,13 +1,5 @@
/** 请求环境配置 */
type ServiceEnv = Record<
EnvType,
{
/** 请求地址 */
url: string;
/** 代理地址 */
proxy: string;
}
>;
type ServiceEnv = Record<EnvType, EnvConfig>;
/** 环境配置 */
const serviceEnvConfig: ServiceEnv = {
@ -31,8 +23,8 @@ const serviceEnvConfig: ServiceEnv = {
*/
export function getEnvConfig(env: ImportMetaEnv) {
const { VITE_ENV_TYPE = 'dev' } = env;
const envConfig = {
http: serviceEnvConfig[VITE_ENV_TYPE]
};
const envConfig = serviceEnvConfig[VITE_ENV_TYPE];
return envConfig;
}