|
@@ -12,6 +12,35 @@ const NODE_ENV = process.env.NODE_ENV;
|
|
|
|
|
|
const port = process.env.port || 9564;
|
|
|
|
|
|
+const baseApiUrlList = {
|
|
|
+ '': '',
|
|
|
+ '/api': 'https://gcls.helxsoft.cn/',
|
|
|
+};
|
|
|
+
|
|
|
+const fileApiUrlList = {
|
|
|
+ '': '',
|
|
|
+ '/file': 'https://file-kf.helxsoft.cn/',
|
|
|
+};
|
|
|
+
|
|
|
+const proxy = {};
|
|
|
+
|
|
|
+if (NODE_ENV === 'development') {
|
|
|
+ proxy[process.env.VUE_APP_BASE_API] = {
|
|
|
+ target: baseApiUrlList[process.env.VUE_APP_BASE_API],
|
|
|
+ changeOrigin: true,
|
|
|
+ pathRewrite: {
|
|
|
+ [`^${process.env.VUE_APP_BASE_API}`]: '',
|
|
|
+ },
|
|
|
+ };
|
|
|
+ proxy[process.env.VUE_APP_FILE] = {
|
|
|
+ target: fileApiUrlList[process.env.VUE_APP_FILE],
|
|
|
+ changeOrigin: true,
|
|
|
+ pathRewrite: {
|
|
|
+ [`^${process.env.VUE_APP_FILE}`]: '',
|
|
|
+ },
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
module.exports = defineConfig({
|
|
|
publicPath: NODE_ENV === 'development' ? '/' : './',
|
|
|
outputDir: 'dist',
|
|
@@ -30,25 +59,7 @@ module.exports = defineConfig({
|
|
|
errors: true,
|
|
|
},
|
|
|
},
|
|
|
- proxy: {
|
|
|
- [process.env.VUE_APP_BASE_API]: {
|
|
|
- // target: 'https://gcls.utschool.cn/',
|
|
|
- target: 'https://gcls.helxsoft.cn/',
|
|
|
- // target: 'https://youthchinesedu.blcup.com/',
|
|
|
- changeOrigin: true,
|
|
|
- pathRewrite: {
|
|
|
- [`^${process.env.VUE_APP_BASE_API}`]: '',
|
|
|
- },
|
|
|
- },
|
|
|
- [process.env.VUE_APP_FILE]: {
|
|
|
- // target: 'https://file-cs.helxsoft.cn',
|
|
|
- target: 'https://file-kf.helxsoft.cn/',
|
|
|
- changeOrigin: true,
|
|
|
- pathRewrite: {
|
|
|
- [`^${process.env.VUE_APP_FILE}`]: '',
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
+ proxy,
|
|
|
},
|
|
|
css: {
|
|
|
loaderOptions: {
|