Merge remote-tracking branch 'origin/release/1.0' into release/1.0
Showing
5 changed files
with
25 additions
and
4 deletions
@@ -4,11 +4,23 @@ | @@ -4,11 +4,23 @@ | ||
4 | </LayoutBody> | 4 | </LayoutBody> |
5 | </template> | 5 | </template> |
6 | <script> | 6 | <script> |
7 | +import _ from 'lodash'; | ||
8 | +import shopService from 'shop-service'; | ||
9 | + | ||
7 | export default { | 10 | export default { |
8 | data() { | 11 | data() { |
9 | return { | 12 | return { |
10 | - iframeUrl: `http://shops.yohobuy.com:30016/supplier/shop/decorationDetail/${this.$user.currentShop.shopsId}/1/editor/0/` | 13 | + iframeUrl: '' |
11 | }; | 14 | }; |
15 | + }, | ||
16 | + created() { | ||
17 | + shopService.findShopsDecorator().then(result => { | ||
18 | + let shop = _.get(result, 'data.list[0]'); | ||
19 | + | ||
20 | + if (shop) { | ||
21 | + this.iframeUrl = `http://shops.yohobuy.com:30016/supplier/shop/decorationDetail/${shop.shopsId}/${shop.shopsType}/editor/${shop.id}/`; | ||
22 | + } | ||
23 | + }); | ||
12 | } | 24 | } |
13 | }; | 25 | }; |
14 | </script> | 26 | </script> |
@@ -86,6 +86,7 @@ const plugin = { | @@ -86,6 +86,7 @@ const plugin = { | ||
86 | } | 86 | } |
87 | }; | 87 | }; |
88 | Vue.switchShop = shopsId => { | 88 | Vue.switchShop = shopsId => { |
89 | + Vue.$store.set(config.storeKeys.user, Rsa.encrypt(Vue.$user)); | ||
89 | Vue.$cookie.set('_sign', shopsId, { | 90 | Vue.$cookie.set('_sign', shopsId, { |
90 | path: '/' | 91 | path: '/' |
91 | }); | 92 | }); |
@@ -24,8 +24,11 @@ const shopService = { | @@ -24,8 +24,11 @@ const shopService = { | ||
24 | return axios.post('/platform/updateShopBaseInfoById', shop) | 24 | return axios.post('/platform/updateShopBaseInfoById', shop) |
25 | .then(result => result.data); | 25 | .then(result => result.data); |
26 | 26 | ||
27 | - } | 27 | + }, |
28 | 28 | ||
29 | + findShopsDecorator() { | ||
30 | + return axios.post('/platform/findBusinessShopsDecorator').then(result => result.data); | ||
31 | + } | ||
29 | }; | 32 | }; |
30 | 33 | ||
31 | export default shopService; | 34 | export default shopService; |
@@ -29,7 +29,8 @@ let domainApis = { | @@ -29,7 +29,8 @@ let domainApis = { | ||
29 | getProduct: '/SellerProductController/getProduct', | 29 | getProduct: '/SellerProductController/getProduct', |
30 | getShopDetailById: '/SellerShopController/getShopDetailById', | 30 | getShopDetailById: '/SellerShopController/getShopDetailById', |
31 | updateShopBaseInfoById: '/SellerShopController/updateShopBaseInfoById', | 31 | updateShopBaseInfoById: '/SellerShopController/updateShopBaseInfoById', |
32 | - uploads: '/fileupload/uploads' | 32 | + uploads: '/fileupload/uploads', |
33 | + findBusinessShopsDecorator: '/ShopsDecoratorRest/findBusinessShopsDecorator' | ||
33 | }, | 34 | }, |
34 | shop: { | 35 | shop: { |
35 | login: '/loginInter' | 36 | login: '/loginInter' |
@@ -63,7 +63,11 @@ module.exports = (req, res, next) => { | @@ -63,7 +63,11 @@ module.exports = (req, res, next) => { | ||
63 | let params = Object.assign(req.query, req.body, baseParams); | 63 | let params = Object.assign(req.query, req.body, baseParams); |
64 | 64 | ||
65 | return api.proxy(apiUrl, params, { | 65 | return api.proxy(apiUrl, params, { |
66 | - method: req.method.toLowerCase() | 66 | + method: req.method.toLowerCase(), |
67 | + headers: { | ||
68 | + 'x-shop-id': currentShop.shopsId, | ||
69 | + 'x-user-id': req.session.LOGIN_UID | ||
70 | + } | ||
67 | }).on('error', error => { | 71 | }).on('error', error => { |
68 | next({code: 500, message: error}); | 72 | next({code: 500, message: error}); |
69 | }).pipe(res); | 73 | }).pipe(res); |
-
Please register or login to post a comment