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

fix(tenant): tenantId字段校验

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