Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

... ... @@ -4,11 +4,23 @@
</LayoutBody>
</template>
<script>
import _ from 'lodash';
import shopService from 'shop-service';
export default {
data() {
return {
iframeUrl: `http://shops.yohobuy.com:30016/supplier/shop/decorationDetail/${this.$user.currentShop.shopsId}/1/editor/0/`
iframeUrl: ''
};
},
created() {
shopService.findShopsDecorator().then(result => {
let shop = _.get(result, 'data.list[0]');
if (shop) {
this.iframeUrl = `http://shops.yohobuy.com:30016/supplier/shop/decorationDetail/${shop.shopsId}/${shop.shopsType}/editor/${shop.id}/`;
}
});
}
};
</script>
... ...
... ... @@ -86,6 +86,7 @@ const plugin = {
}
};
Vue.switchShop = shopsId => {
Vue.$store.set(config.storeKeys.user, Rsa.encrypt(Vue.$user));
Vue.$cookie.set('_sign', shopsId, {
path: '/'
});
... ...
... ... @@ -24,8 +24,11 @@ const shopService = {
return axios.post('/platform/updateShopBaseInfoById', shop)
.then(result => result.data);
}
},
findShopsDecorator() {
return axios.post('/platform/findBusinessShopsDecorator').then(result => result.data);
}
};
export default shopService;
... ...
... ... @@ -29,7 +29,8 @@ let domainApis = {
getProduct: '/SellerProductController/getProduct',
getShopDetailById: '/SellerShopController/getShopDetailById',
updateShopBaseInfoById: '/SellerShopController/updateShopBaseInfoById',
uploads: '/fileupload/uploads'
uploads: '/fileupload/uploads',
findBusinessShopsDecorator: '/ShopsDecoratorRest/findBusinessShopsDecorator'
},
shop: {
login: '/loginInter'
... ...
... ... @@ -63,7 +63,11 @@ module.exports = (req, res, next) => {
let params = Object.assign(req.query, req.body, baseParams);
return api.proxy(apiUrl, params, {
method: req.method.toLowerCase()
method: req.method.toLowerCase(),
headers: {
'x-shop-id': currentShop.shopsId,
'x-user-id': req.session.LOGIN_UID
}
}).on('error', error => {
next({code: 500, message: error});
}).pipe(res);
... ...