From 49d342dc64e74be6cb4e349817e4c98528c6dbc2 Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Tue, 4 Jun 2024 17:28:49 +0800 Subject: [PATCH] uu --- common/api/url.js | 5 +++-- common/env.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 common/env.js diff --git a/common/api/url.js b/common/api/url.js index 25b0990..883ce54 100644 --- a/common/api/url.js +++ b/common/api/url.js @@ -1,5 +1,6 @@ -// TODO 区分环境 -export const host = 'http://47.102.220.189:58089/api/bizsvr' +import { curEnvConf } from "../env" + +export const host = curEnvConf.apiHost export default { uploadFile: '/common/ossUpload', diff --git a/common/env.js b/common/env.js new file mode 100644 index 0000000..5c0fc1c --- /dev/null +++ b/common/env.js @@ -0,0 +1,19 @@ +let envMap = { + development: { + apiHost: 'http://47.102.220.189:58089/api/bizsvr', + }, + production: { + apiHost: 'http://api.emis.tanex56.com/api/bizsvr', + } +} +let curEnvConf +if (process.env.NODE_ENV === 'development') { + curEnvConf = envMap.development + console.log('开发环境curEnvConf======', curEnvConf) +} else { + curEnvConf = envMap.production + console.log('正式环境curEnvConf======', curEnvConf) +} +export { + curEnvConf +} \ No newline at end of file