提交 44c034be 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

feat 微信小程序环境变量

上级 ec2142a9
...@@ -3,6 +3,9 @@ NODE_ENV=production ...@@ -3,6 +3,9 @@ NODE_ENV=production
# 自定义 VUE_APP_ENV # 自定义 VUE_APP_ENV
VUE_APP_ENV ='uat' VUE_APP_ENV ='uat'
# 微信小程序的环境变量
VUE_APP_MINI_PROGRAM_ENV='trial'
VUE_APP_SERVICE_URL=https://uat-sc.yunqueyi.com VUE_APP_SERVICE_URL=https://uat-sc.yunqueyi.com
# 阿里云OSS对象存储地址 # 阿里云OSS对象存储地址
......
...@@ -170,9 +170,8 @@ export default { ...@@ -170,9 +170,8 @@ export default {
handleActivityRemind() { handleActivityRemind() {
if (this.errorMsg) return this.$toast(this.errorMsg); if (this.errorMsg) return this.$toast(this.errorMsg);
const isProd = process.env.NODE_ENV === 'production'; if (process.env.VUE_APP_MINI_PROGRAM_ENV) {
if (isProd) { this.appletConfig.env_version = process.env.VUE_APP_MINI_PROGRAM_ENV;
this.appletConfig.env_version = 'release';
} }
location.href = this.appletUrl(); location.href = this.appletUrl();
}, },
......
...@@ -253,9 +253,8 @@ export default { ...@@ -253,9 +253,8 @@ export default {
if (this.hideWeApp) { if (this.hideWeApp) {
this.$toast('活动已结束'); this.$toast('活动已结束');
} else { } else {
const isProd = process.env.NODE_ENV === 'production'; if (process.env.VUE_APP_MINI_PROGRAM_ENV) {
if (isProd) { this.appletConfig.env_version = process.env.VUE_APP_MINI_PROGRAM_ENV;
this.appletConfig.env_version = 'release';
} }
location.href = this.appletUrl(); location.href = this.appletUrl();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册