有什么方法可以区分环境吗,不想来回切服务器地址
https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html
if
(
typeof
__wxConfig ==
"object"
){
let version = __wxConfig.envVersion;
console.log(
"当前环境:"
+ version)
(version ==
"develop"
//工具或者真机 开发环境
}
else
"trial"
//测试环境(体验版)
"release"
//正式环境