trustbase-seller-backend 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/web/dist/app.js +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trustbase-seller-backend",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "TrustBase Seller Backend (merchant edition) — 商品上链/订单/支付/质押 write API for TrustBase 保障链生态. 单卖家自托管形态: 签名 key 即卖家身份, 私钥不出门.",
5
5
  "main": "run-unified.js",
6
6
  "bin": {
package/web/dist/app.js CHANGED
@@ -10,6 +10,14 @@ const API = window.location.origin + '/api';
10
10
  const app = document.getElementById('app');
11
11
  const offlineBar = document.getElementById('offline-bar');
12
12
 
13
+ // 2026-10-17 kimi: 不再静默白屏 — 把启动/脚本/异步错误直接显示在页面上。
14
+ function showFatalError(where, err) {
15
+ const msg = err && err.message ? err.message : String(err || '未知错误');
16
+ app.innerHTML = `<div class="empty"><div class="empty-icon">⚠️</div><p>${esc(where)}: ${esc(msg)}</p></div>`;
17
+ }
18
+ window.addEventListener('error', (e) => showFatalError('脚本错误', e.error || e.message));
19
+ window.addEventListener('unhandledrejection', (e) => showFatalError('异步错误', e.reason));
20
+
13
21
  // ============================================================
14
22
  // 状态管理 (极简)
15
23
  // ============================================================