This commit is contained in:
aihe 2024-06-04 17:28:49 +08:00
parent aa8141f654
commit 49d342dc64
2 changed files with 22 additions and 2 deletions

View File

@ -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',

19
common/env.js Normal file
View File

@ -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
}