diff --git a/config/config.web.ts b/config/config.dev.ts similarity index 70% rename from config/config.web.ts rename to config/config.dev.ts index 1b60ddf..ea8da12 100644 --- a/config/config.web.ts +++ b/config/config.dev.ts @@ -3,9 +3,9 @@ import { defineConfig } from 'umi'; export default defineConfig({ define: { 'process.env': { - msg: '现在是 web 环境!', + msg: '现在是 dev 环境!', request: { - prefix: '/api', + prefix: 'api', }, }, }, diff --git a/config/config.electron.ts b/config/config.prod.ts similarity index 55% rename from config/config.electron.ts rename to config/config.prod.ts index 9105eb0..b8878d2 100644 --- a/config/config.electron.ts +++ b/config/config.prod.ts @@ -3,10 +3,9 @@ import { defineConfig } from 'umi'; export default defineConfig({ define: { 'process.env': { - msg: '现在是 electron 环境!', - electron: 'electron', + msg: '现在是 prod 环境!', request: { - prefix: 'http://admin.ballcat.cn/api', + prefix: 'api', }, }, }, diff --git a/config/config.uat.ts b/config/config.uat.ts new file mode 100644 index 0000000..d9f8a96 --- /dev/null +++ b/config/config.uat.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'umi'; + +export default defineConfig({ + define: { + 'process.env': { + msg: '现在是 uat 环境!', + request: { + prefix: 'api', + }, + }, + }, +}); diff --git a/package.json b/package.json index 02edd6d..9fbb25d 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "private": true, "description": "Ballcat", "scripts": { - "start": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=web umi dev", + "start": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=dev umi dev", "start:uat": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=uat umi dev", "start:prod": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=prod umi dev", - "build": "cross-env UMI_ENV=web umi build", + "build": "cross-env UMI_ENV=dev umi build", "build:uat": "cross-env UMI_ENV=uat umi build", "build:prod": "cross-env UMI_ENV=prod umi build", "analyze": "cross-env ANALYZE=1 umi build",