trustbase-seller-backend 0.7.4 → 0.7.6

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.
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.6",
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
  // ============================================================
@@ -121,6 +121,6 @@
121
121
  <div class="offline-bar" id="offline-bar">⚠ 网络已断开,显示缓存内容</div>
122
122
  <div class="container" id="app"></div>
123
123
 
124
- <script type="module" src="/app.js?v=20261017a"></script>
124
+ <script src="/app.js?v=20261017a"></script>
125
125
  </body>
126
126
  </html>
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html><head><meta charset="UTF-8"><title>module</title></head><body><script type="module" src="/test.js"></script></body></html>
@@ -0,0 +1 @@
1
+ document.body.innerHTML = "<h1>External JS works</h1>";