From 09725acad7707e306b0e979dc8e53fc11a1b8712 Mon Sep 17 00:00:00 2001 From: iven Date: Sun, 10 May 2026 17:20:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(miniprogram):=20=E8=AE=BF=E5=AE=A2?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=94=AF=E6=8C=81=E6=97=A0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=80=81=E8=8E=B7=E5=8F=96=E8=BD=AE=E6=92=AD=E5=9B=BE=EF=BC=88?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=97=B6=E6=B3=A8=E5=85=A5=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=20tenant=5Fid=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/miniprogram/config/index.ts | 1 + apps/miniprogram/src/pages/index/index.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/miniprogram/config/index.ts b/apps/miniprogram/config/index.ts index 6fac855..bd35460 100644 --- a/apps/miniprogram/config/index.ts +++ b/apps/miniprogram/config/index.ts @@ -19,6 +19,7 @@ export default defineConfig(async (merge) => { 'process.env.TARO_APP_WX_TEMPLATE_REPORT': JSON.stringify(process.env.TARO_APP_WX_TEMPLATE_REPORT || ''), 'process.env.TARO_APP_WX_TEMPLATE_CRITICAL_ALERT': JSON.stringify(process.env.TARO_APP_WX_TEMPLATE_CRITICAL_ALERT || ''), 'process.env.TARO_APP_WX_TEMPLATE_HEALTH_ABNORMAL': JSON.stringify(process.env.TARO_APP_WX_TEMPLATE_HEALTH_ABNORMAL || ''), + 'process.env.TARO_APP_DEFAULT_TENANT_ID': JSON.stringify(process.env.TARO_APP_DEFAULT_TENANT_ID || ''), }, copy: { patterns: [], options: {} }, framework: 'react', diff --git a/apps/miniprogram/src/pages/index/index.tsx b/apps/miniprogram/src/pages/index/index.tsx index efe6854..ac3f995 100644 --- a/apps/miniprogram/src/pages/index/index.tsx +++ b/apps/miniprogram/src/pages/index/index.tsx @@ -49,7 +49,10 @@ function GuestHome({ modeClass }: { modeClass: string }) { }); const loadPublicData = async () => { - const tenantId = Taro.getStorageSync('tenant_id'); + let tenantId = Taro.getStorageSync('tenant_id'); + if (!tenantId) { + tenantId = process.env.TARO_APP_DEFAULT_TENANT_ID || ''; + } if (!tenantId) { setBanners(FALLBACK_SLIDES); return;