fix(critical): 登录页白屏——notify.js的import.meta在小程序CJS互操作下编译为__filename访问,模块顶层崩溃;改为编译期常量;版本v1.4.9

This commit is contained in:
Hermes Agent
2026-09-19 22:06:09 +08:00
parent de125dae67
commit 726e5125a7
2 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "宇之然AI维度", "name": "宇之然AI维度",
"appid": "wxdad62baf4ccd09e3", "appid": "wxdad62baf4ccd09e3",
"versionName": "1.4.8", "versionName": "1.4.9",
"versionCode": "100", "versionCode": "100",
"description": "AI 知识探索社区 — 从5个维度系统理解人工智能", "description": "AI 知识探索社区 — 从5个维度系统理解人工智能",
"uni-app": { "uni-app": {
+8 -4
View File
@@ -1,9 +1,13 @@
import { request } from './api' import { request } from './api'
// 订阅消息模板ID(通过 VITE_NOTIFY_TMPL 环境变量注入;未配置时不请求) // 订阅消息模板ID:编译期注入(.env.production 配 VITE_NOTIFY_TMPL=模板ID);
const TMPL_IDS = [ // 不用 import.meta 运行时访问(其 CJS 互操作产物在小程序内会因 __filename 崩溃导致页面白屏)
(import.meta && import.meta.env && import.meta.env.VITE_NOTIFY_TMPL) || '', // #ifdef MP-WEIXIN
].filter(Boolean) 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
/** /**
* 请求订阅授权(在用户完成关键动作后调用,此时微信允许弹授权框) * 请求订阅授权(在用户完成关键动作后调用,此时微信允许弹授权框)