Commit c06e7e7d authored by 郭志伟's avatar 郭志伟

fix(tenant): tenantId字段校验

parent e7d6e670
...@@ -3,7 +3,7 @@ import config from '../config'; ...@@ -3,7 +3,7 @@ import config from '../config';
export default { export default {
getPageById(params) { getPageById(params) {
return http.get(`${config.apiHost}/editor/get/${params.pageId}?lite=1`); return http.get(`http://127.0.0.1:7002/editor/get/${params.pageId}?lite=1`);
}, },
getShopCartCount() { getShopCartCount() {
return http.get(`${config.kdspHost}/api/kdsp/shop-cart/count`); return http.get(`${config.kdspHost}/api/kdsp/shop-cart/count`);
......
...@@ -7,7 +7,10 @@ const hostMap = { ...@@ -7,7 +7,10 @@ const hostMap = {
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-vcc3.liangkebang.net`, mallHost: `${protocol}://mall-vcc3.liangkebang.net`,
test: true, test: true,
yxmTenantId: 560761 yxmTenantId: 560761,
appIdMap: {
560761: 'wxe16bf9293671506c'
},
}; };
if (EASY_ENV_IS_BROWSER) { if (EASY_ENV_IS_BROWSER) {
......
...@@ -6,5 +6,8 @@ export default { ...@@ -6,5 +6,8 @@ export default {
shenceUrl: `https://bn.xyqb.com/sa?project=production`, shenceUrl: `https://bn.xyqb.com/sa?project=production`,
mallHost: `https://mall.q-gp.com`, mallHost: `https://mall.q-gp.com`,
test: false, test: false,
yxmTenantId: 560761 yxmTenantId: 560761,
appIdMap: {
560761: 'wxb3e6270e1b1e0bc7'
},
}; };
...@@ -7,7 +7,10 @@ const hostMap = { ...@@ -7,7 +7,10 @@ const hostMap = {
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-test1.liangkebang.net`, mallHost: `${protocol}://mall-test1.liangkebang.net`,
test: true, test: true,
yxmTenantId: 560761 yxmTenantId: 560761,
appIdMap: {
560761: 'wxe16bf9293671506c'
},
}; };
if (EASY_ENV_IS_BROWSER) { if (EASY_ENV_IS_BROWSER) {
......
...@@ -6,3 +6,4 @@ interface Window { ...@@ -6,3 +6,4 @@ interface Window {
xyqbNativeEvent: any; xyqbNativeEvent: any;
} }
declare var apollo: any; declare var apollo: any;
declare var tenantId: any;
...@@ -48,6 +48,7 @@ export default { ...@@ -48,6 +48,7 @@ export default {
mpSchema: '', mpSchema: '',
link: '', link: '',
shareInfo: {}, shareInfo: {},
wxAppId: cfg.appIdMap[+localStorage.get('tenantId')],
showShareOverlay: ((isWechat && !isWxMp) || isH5Normal) && !localStorage.get('vccChannel'), showShareOverlay: ((isWechat && !isWxMp) || isH5Normal) && !localStorage.get('vccChannel'),
isWechat isWechat
}; };
...@@ -105,9 +106,11 @@ export default { ...@@ -105,9 +106,11 @@ export default {
methods: { methods: {
async getMpSchema() { async getMpSchema() {
if (isH5Normal && EASY_ENV_IS_BROWSER) { if (isH5Normal && EASY_ENV_IS_BROWSER && this.wxAppId) {
try { try {
const [schema] = await api.getMpSchema({ const [schema] = await api.getMpSchema({
// TODO
miniAppId: this.wxAppId,
miniUrl: WEAPP_PATH, miniUrl: WEAPP_PATH,
params: `url=${encodeURIComponent(JSON.stringify(this.link))}` params: `url=${encodeURIComponent(JSON.stringify(this.link))}`
}); });
...@@ -181,7 +184,7 @@ export default { ...@@ -181,7 +184,7 @@ export default {
this.jsBridge.showShareView(this.shareInfo); this.jsBridge.showShareView(this.shareInfo);
}, },
postMpShareInfo() { postMpShareInfo() {
if (EASY_ENV_IS_NODE) return; if (EASY_ENV_IS_NODE || !this.wxAppId) return;
const wx = require('weixin-js-sdk'); const wx = require('weixin-js-sdk');
const { shareInfo } = this; const { shareInfo } = this;
wx.miniProgram.postMessage({ data: shareInfo }); wx.miniProgram.postMessage({ data: shareInfo });
......
...@@ -20,6 +20,7 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin, Disab ...@@ -20,6 +20,7 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin, Disab
@State(state => state.activity.pageInfo.pageName) pageName; @State(state => state.activity.pageInfo.pageName) pageName;
@State(state => state.activity.noPageData) noPageData; @State(state => state.activity.noPageData) noPageData;
@State(state => state.activity.pageInfo.appLoginState) appLoginState; @State(state => state.activity.pageInfo.appLoginState) appLoginState;
@State(state => state.activity.pageInfo.tenantId) tenantId;
@State(state => state.activity.gridLayout.rowHeight) rowHeight; @State(state => state.activity.gridLayout.rowHeight) rowHeight;
@Mutation('SET_PAGE_ELEMENTS') setPageElement; @Mutation('SET_PAGE_ELEMENTS') setPageElement;
@Mutation('UPDATE_APP_LOGIN_STATE') updateAppLoginState; @Mutation('UPDATE_APP_LOGIN_STATE') updateAppLoginState;
...@@ -44,6 +45,9 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin, Disab ...@@ -44,6 +45,9 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin, Disab
} }
return this.pageData && this.pageData.elements.map(v => v.point) || []; return this.pageData && this.pageData.elements.map(v => v.point) || [];
} }
get tenantIdCorrect() {
return +this.tenantId === +localStorage.get('tenantId');
}
@Watch('pageData', { deep: true }) @Watch('pageData', { deep: true })
onPageDataChange(val) { onPageDataChange(val) {
......
<template> <template>
<div class="activity" :style="transformStyle(pageData.commonStyle)"> <div class="activity" :style="transformStyle(pageData.commonStyle)">
<template v-if="!noPageData"> <template v-if="!noPageData && tenantIdCorrect">
<div class="layout"> <div class="layout">
<div :style="transformStyle(item.commonStyle, item.point, item.name)" v-for="(item, index) in pageData.elements" <div :style="transformStyle(item.commonStyle, item.point, item.name)" v-for="(item, index) in pageData.elements"
:key="fixGridKey(item)" :key="fixGridKey(item)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment