feat: h5区分正式环境和开发环境

pull/16/head
TianYu 2023-05-25 13:47:20 +08:00
parent 99f1fb5e33
commit 4802eef97e
3 changed files with 24 additions and 4 deletions

View File

@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"

View File

@ -1,14 +1,12 @@
let domain = 'http://api.cyywl.top'
// let domain = 'http://192.168.1.147:48080'
let domain = process.env.APP_BASE_URL
module.exports = {
// 请求域名 格式: https://您的域名
// #ifdef MP
HTTP_REQUEST_URL: domain,
// #endif
HTTP_ADMIN_URL:'http://api.cyywl.top', //PC后台的API请求地址上传图片用
// HTTP_ADMIN_URL:'http://192.168.1.147:48080', //PC后台的API请求地址上传图片用
HTTP_ADMIN_URL: process.env.APP_BASE_URL, //PC后台的API请求地址上传图片用
// #ifdef H5
//H5接口是浏览器地址
// HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host,

View File

@ -13,5 +13,23 @@
"clipboard": "^2.0.11",
"html-to-image": "^1.11.11",
"qrcode": "^1.5.3"
},
"uni-app": {
"scripts": {
"dev": {
"title": "开发版",
"env": {
"UNI_PLATFORM": "h5",
"APP_BASE_URL": "http://192.168.1.147:48080"
}
},
"prod": {
"title": "生产版",
"env": {
"UNI_PLATFORM": "h5",
"APP_BASE_URL": "http://api.cyywl.top"
}
}
}
}
}