Jelajahi Sumber

feat: 地址替换

hzy 7 bulan lalu
induk
melakukan
54dd085aff

+ 1 - 1
Logan/LoganSite/.env.development

@@ -1 +1 @@
-API_BASE_URL=/api/
+API_BASE_URL=/api/service-logan/

+ 1 - 11
Logan/LoganSite/config/webpack.config.js

@@ -135,17 +135,7 @@ module.exports = function (webpackEnv) {
 
   return {
     mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
-    devServer: {
-      logLevel: 'debug',
-      proxy: {
-        '/api': {
-          target: 'http://pengyi.w1.luyouxia.net/api/service-logan',
-          pathRewrite: { '^/api': '' },
-          changeOrigin: true,
-          secure: false,
-        },
-      },
-    },
+
     // Stop compilation early in production
     bail: isEnvProduction,
     devtool: isEnvProduction

+ 2 - 2
Logan/LoganSite/config/webpackDevServer.config.js

@@ -82,9 +82,9 @@ module.exports = function (proxy, allowedHost) {
     },
     public: allowedHost,
     proxy: {
-      '/api': {
+      '/api/service-logan': {
         target: 'http://pengyi.w1.luyouxia.net/api/service-logan',
-        pathRewrite: { '^/api': '' },
+        pathRewrite: { '^/api/service-logan': '' },
         changeOrigin: true,
         secure: false,
       },