3
0
Fork 0

chore(package): add env

This commit is contained in:
ywk 2025-04-09 09:30:26 +08:00
parent 21b75f40b8
commit f72f4930fa
2 changed files with 32 additions and 1 deletions

View File

@ -10,7 +10,16 @@ module.exports = (vm) => {
uni.$u.http.setConfig((config) => { uni.$u.http.setConfig((config) => {
// config.baseURL = 'https://p1.hzs413.com/inter-api'; // config.baseURL = 'https://p1.hzs413.com/inter-api';
// 192.168.0.100:8080 // 192.168.0.100:8080
//#ifdef DEV_SERVER
console.log('DEV_SERVER')
config.baseURL = 'http://192.168.0.100:8080';
//#endif
//#ifdef QA_SERVER
console.log('QA_SERVER')
config.baseURL = 'http://60.205.203.247/prod-api'; config.baseURL = 'http://60.205.203.247/prod-api';
//#endif
config.timeout = 30000; config.timeout = 30000;
return config return config
}) })

View File

@ -33,5 +33,27 @@
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC" "license": "ISC",
"uni-app": {
"scripts": {
"dev-env": {
"title": "开发环境",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"DEV_SERVER": true
}
},
"prod-env": {
"title": "测试环境",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"QA_SERVER": true
}
}
}
}
} }