refactor(env): 重构环境变量配置并简化项目设置
-移除了大部分冗余环境变量,简化了配置结构 - 更新了 API 地址配置方式,使用 VITE_API_URL 替代原有变量 - 删除了未使用的代码文件,包括 apiCodes.ts、axiosHandler.ts 和 types.d.ts - 调整了 vite 配置,使用环境变量中的 API地址 - 更新了 gitignore 文件,添加了 dist 目录的忽略项
This commit is contained in:
@ -3,8 +3,10 @@ import { configAutoImport, configComponents,configIcons } from './unplugin';
|
||||
import viteCompression from 'vite-plugin-compression';
|
||||
import progress from 'vite-plugin-progress';
|
||||
import defineOptions from 'unplugin-vue-define-options/vite';
|
||||
import { setServerConfig } from './utils';
|
||||
|
||||
export * from './utils';
|
||||
// 移除可能导致循环引用的导出
|
||||
// export * from './utils';
|
||||
|
||||
export const pluginsConfig = [
|
||||
configUnocss(),
|
||||
@ -17,3 +19,6 @@ export const pluginsConfig = [
|
||||
include: [/\.vue$/, /\.vue\?vue/],
|
||||
}),
|
||||
];
|
||||
|
||||
export { resolve } from './utils';
|
||||
export { setServerConfig };
|
||||
@ -62,10 +62,10 @@ export const setServerConfig =
|
||||
return {
|
||||
port: Number(env.APP_PORT),
|
||||
proxy: {
|
||||
[env.EO_API_URL]: {
|
||||
target: env.API_PROXY,
|
||||
'/api': {
|
||||
target: env.VITE_API_URL || 'http://lingjiapi.lvfunai.com/api',
|
||||
changeOrigin: true,
|
||||
rewrite: (path: string) => path.replace(env.EO_API_URL, ''),
|
||||
rewrite: (path: string) => path.replace(/^\/api/, ''),
|
||||
},
|
||||
},
|
||||
...opts,
|
||||
|
||||
Reference in New Issue
Block a user