From 726e5125a75722d3b7083f4566e8dd8ac5baa5b5 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 19 Sep 2026 22:06:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(critical):=20=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E7=99=BD=E5=B1=8F=E2=80=94=E2=80=94notify.js=E7=9A=84import.me?= =?UTF-8?q?ta=E5=9C=A8=E5=B0=8F=E7=A8=8B=E5=BA=8FCJS=E4=BA=92=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=B8=8B=E7=BC=96=E8=AF=91=E4=B8=BA=5F=5Ffilename?= =?UTF-8?q?=E8=AE=BF=E9=97=AE,=E6=A8=A1=E5=9D=97=E9=A1=B6=E5=B1=82?= =?UTF-8?q?=E5=B4=A9=E6=BA=83;=E6=94=B9=E4=B8=BA=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=9C=9F=E5=B8=B8=E9=87=8F;=E7=89=88=E6=9C=ACv1.4.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/manifest.json | 2 +- client/src/utils/notify.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/src/manifest.json b/client/src/manifest.json index 0591ead..a4226cf 100644 --- a/client/src/manifest.json +++ b/client/src/manifest.json @@ -1,7 +1,7 @@ { "name": "宇之然AI维度", "appid": "wxdad62baf4ccd09e3", - "versionName": "1.4.8", + "versionName": "1.4.9", "versionCode": "100", "description": "AI 知识探索社区 — 从5个维度系统理解人工智能", "uni-app": { diff --git a/client/src/utils/notify.js b/client/src/utils/notify.js index 9a1a7ef..0dd1238 100644 --- a/client/src/utils/notify.js +++ b/client/src/utils/notify.js @@ -1,9 +1,13 @@ import { request } from './api' -// 订阅消息模板ID(通过 VITE_NOTIFY_TMPL 环境变量注入;未配置时不请求) -const TMPL_IDS = [ - (import.meta && import.meta.env && import.meta.env.VITE_NOTIFY_TMPL) || '', -].filter(Boolean) +// 订阅消息模板ID:编译期注入(.env.production 配 VITE_NOTIFY_TMPL=模板ID); +// 不用 import.meta 运行时访问(其 CJS 互操作产物在小程序内会因 __filename 崩溃导致页面白屏) +// #ifdef MP-WEIXIN +const TMPL_IDS = (typeof VITE_NOTIFY_TMPL !== 'undefined' && VITE_NOTIFY_TMPL) ? [VITE_NOTIFY_TMPL] : [] +// #endif +// #ifndef MP-WEIXIN +const TMPL_IDS = (import.meta.env && import.meta.env.VITE_NOTIFY_TMPL) ? [import.meta.env.VITE_NOTIFY_TMPL] : [] +// #endif /** * 请求订阅授权(在用户完成关键动作后调用,此时微信允许弹授权框)