Authored by 李奇
Committed by 李奇

发布之前设置业务域名

@@ -132,6 +132,12 @@ export default { @@ -132,6 +132,12 @@ export default {
132 return this.$Message.error(resultDomains.errmsg); 132 return this.$Message.error(resultDomains.errmsg);
133 } 133 }
134 134
  135 + const setWebviewDomains = await this.$store.dispatch('eshop/setWebviewDomains', row);
  136 +
  137 + if (setWebviewDomains && setWebviewDomains.errcode !== 0) {
  138 + return this.$Message.error(setWebviewDomains.errmsg);
  139 + }
  140 +
135 const resultRelease = await this.$store.dispatch('eshop/fetchWxRelease', row); 141 const resultRelease = await this.$store.dispatch('eshop/fetchWxRelease', row);
136 142
137 if (resultRelease && resultRelease.errcode === 0) { 143 if (resultRelease && resultRelease.errcode === 0) {
@@ -167,6 +167,25 @@ export default { @@ -167,6 +167,25 @@ export default {
167 } 167 }
168 }); 168 });
169 }, 169 },
  170 + async setWebviewDomains({dispatch}, {authAppId}) {
  171 + const token = await dispatch('fetchShopToken', {appid: authAppId});
  172 +
  173 + return await this.$nodeApi.post('/wx', {
  174 + url: `/wxa/setwebviewdomain?access_token=${token}`,
  175 + method: 'post',
  176 + params: {
  177 + action: 'set',
  178 + webviewdomain: [
  179 + 'https://m.yohobuy.com',
  180 + 'https://union.yoho.cn',
  181 + 'https://ad.yoho.cn',
  182 + 'https://activity.yoho.cn',
  183 + 'https://action.yoho.cn',
  184 + 'https://feature.yoho.cn'
  185 + ]
  186 + }
  187 + });
  188 + },
170 async fetchWxRelease({dispatch}, {authAppId}) { 189 async fetchWxRelease({dispatch}, {authAppId}) {
171 const token = await dispatch('fetchShopToken', {appid: authAppId}); 190 const token = await dispatch('fetchShopToken', {appid: authAppId});
172 191