Authored by 李奇
Committed by 李奇

发布之前设置业务域名

... ... @@ -132,6 +132,12 @@ export default {
return this.$Message.error(resultDomains.errmsg);
}
const setWebviewDomains = await this.$store.dispatch('eshop/setWebviewDomains', row);
if (setWebviewDomains && setWebviewDomains.errcode !== 0) {
return this.$Message.error(setWebviewDomains.errmsg);
}
const resultRelease = await this.$store.dispatch('eshop/fetchWxRelease', row);
if (resultRelease && resultRelease.errcode === 0) {
... ...
... ... @@ -167,6 +167,25 @@ export default {
}
});
},
async setWebviewDomains({dispatch}, {authAppId}) {
const token = await dispatch('fetchShopToken', {appid: authAppId});
return await this.$nodeApi.post('/wx', {
url: `/wxa/setwebviewdomain?access_token=${token}`,
method: 'post',
params: {
action: 'set',
webviewdomain: [
'https://m.yohobuy.com',
'https://union.yoho.cn',
'https://ad.yoho.cn',
'https://activity.yoho.cn',
'https://action.yoho.cn',
'https://feature.yoho.cn'
]
}
});
},
async fetchWxRelease({dispatch}, {authAppId}) {
const token = await dispatch('fetchShopToken', {appid: authAppId});
... ...