From cd2fefb131e1ddbff7cf42d24eb54739bf2d66bd Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Wed, 29 Apr 2020 16:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9appconfig.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/webpack.config.prod.js | 3 +-- src/AppConfig.js | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 068677fe..1fc0f0ca 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -20,14 +20,13 @@ const getClientEnvironment = require('./env'); // Some apps do not use client-side routing with pushState. // For these, "homepage" can be set to "." to enable relative asset paths. let publicPath = '/react/build/'; -let nodeEnv = process.env.NODE_ENV +// let nodeEnv = process.env.NODE_ENV // if (nodeEnv === 'testBuild') { // publicPath = 'https://testforgeplus.trustie.net/react/build/'; // } // if (nodeEnv === 'production') { // publicPath = 'https://forgeplus.trustie.net/react/build/'; // } -// publicPath = 'https://forgeplus.trustie.net/react/build/'; const publicUrl = publicPath.slice(0, -1); const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'; const env = getClientEnvironment(publicPath); diff --git a/src/AppConfig.js b/src/AppConfig.js index dfb7e19a..371c3b37 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -115,13 +115,13 @@ export function initAxiosInterceptors(props) { // https://github.com/axios/axios/issues/1497 // TODO 读取到package.json中的配置? - var proxy = "http://localhost:3004" + var proxy = "http://localhost:3000" // proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.educoder.net" // proxy = "https://testeduplus2.educoder.net" //proxy="http://47.96.87.25:48080" - // proxy = "https://pre-newweb.educoder.net" - // proxy = "https://testforgeplus.trustie.net/" + proxy = "https://pre-newweb.educoder.net" + proxy = "https://testforgeplus.trustie.net/" // proxy="https://test-jupyterweb.educoder.net" // proxy="https://test-newweb.educoder.net" // proxy="https://test-jupyterweb.educoder.net" @@ -224,6 +224,8 @@ export function initAxiosInterceptors(props) { } else { config.url = `${config.url}&debug=${debugType}`; } + }else{ + config.url=url; } setpostcookie(); }