diff --git a/yudao-ui-app/.hbuilderx/launch.json b/yudao-ui-app/.hbuilderx/launch.json index ee5be7746..4bbcf3cba 100644 --- a/yudao-ui-app/.hbuilderx/launch.json +++ b/yudao-ui-app/.hbuilderx/launch.json @@ -10,6 +10,10 @@ { "launchtype" : "local" }, + "h5" : + { + "launchtype" : "local" + }, "mp-weixin" : { "launchtype" : "local" diff --git a/yudao-ui-app/config/app.js b/yudao-ui-app/config/app.js index 3f3bbf134..2932f77a1 100644 --- a/yudao-ui-app/config/app.js +++ b/yudao-ui-app/config/app.js @@ -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, diff --git a/yudao-ui-app/package.json b/yudao-ui-app/package.json index e147ae429..c33a2c9b1 100644 --- a/yudao-ui-app/package.json +++ b/yudao-ui-app/package.json @@ -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" + } + } + } } }