wwt-platform 1.1.21 → 1.1.22

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": "wwt-platform",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "WWT 工作平台 - 平台本体与工具清单分发",
5
5
  "files": [
6
6
  "platform.html",
package/platform.html CHANGED
@@ -1442,7 +1442,7 @@ function doAddMod(){
1442
1442
  // ═══════════════════════════════════════════════════════════
1443
1443
  // 平台更新(方案B:平台 + 内置工具统一检查)
1444
1444
  // ═══════════════════════════════════════════════════════════
1445
- const PLATFORM_VER = '1.1.21';
1445
+ const PLATFORM_VER = '1.1.22';
1446
1446
  const NPM_PKG = 'wwt-platform'; // NPM 包名(主力分发源)
1447
1447
  const GITEE_TOKEN_KEY = 'wwt_gitee_token';
1448
1448
  const GITEE_TOKEN_DEF = 'e45883b9c89b8d9689746ce42bbc2b0b';
@@ -1467,7 +1467,7 @@ const SOURCES = [
1467
1467
  // 更新清单:每个条目 = 一个可更新对象(平台或工具)
1468
1468
  // 这是「离线兜底种子」——联网时会与远程 tools.json 合并,远程为准
1469
1469
  const UPD_REG_DEF = [
1470
- {key:'platform', name:'WWT 工作平台', cur:'1.1.21', repo:GITEE_PLATFORM_REPO, verFile:'version.js', appFile:'app.js', pat:'__WWT_PLATFORM_VER', kind:'platform'},
1470
+ {key:'platform', name:'WWT 工作平台', cur:'1.1.22', repo:GITEE_PLATFORM_REPO, verFile:'version.js', appFile:'app.js', pat:'__WWT_PLATFORM_VER', kind:'platform'},
1471
1471
  {key:'erp-recon', name:'ERP 对账工具', cur:'V1.0.2',repo:'wwtmrhu/erp-recon', verFile:'version.js', appFile:'app.js', pat:'__ERP_LATEST_VER'},
1472
1472
  {key:'erp-tool', name:'ERP 对账单生成匹配', cur:'1.0.0', repo:'wwtmrhu/erp-tool', verFile:'version.js', appFile:'app.js', pat:'__ERP_LATEST_VER'},
1473
1473
  {key:'voucher', name:'WWT 凭证工具', cur:'P1.2.12',repo:'wwtmrhu/certificate-generation', verFile:'dist/version.json', appFile:'', pat:'ver', appUrl:true}
@@ -1519,7 +1519,9 @@ async function fetchGiteeFile(repo, filename, token) {
1519
1519
  if (resp.status === 401) { _updBadToken = true; throw new Error('token 失效(401)'); }
1520
1520
  if (!resp.ok) throw new Error('HTTP ' + resp.status);
1521
1521
  const json = await resp.json();
1522
- return atob((json.content||'').replace(/\n/g, ''));
1522
+ // API 给的是 base64;atob 只得到 Latin-1 字符串,中文会烂成「ERP对账工å·」,
1523
+ // 必须再按 UTF-8 解码。清单(tools.json)也走这里,名字/描述写进 UPD_REG 后就长期是乱码。
1524
+ return new TextDecoder('utf-8').decode(b64ToBytes(b64FromApiJson(json)));
1523
1525
  }
1524
1526
 
1525
1527
  // ═══════════════════════════════════════════════════════════
@@ -1738,11 +1740,11 @@ async function downloadToolContent(it) {
1738
1740
  const sep = json.url.indexOf('?') >= 0 ? '&' : '?';
1739
1741
  const resp = await fetch(json.url + sep + 'access_token=' + encodeURIComponent(getGiteeToken()), {cache:'no-store'});
1740
1742
  if (!resp.ok) throw new Error('HTTP ' + resp.status);
1741
- return atob(b64FromApiJson(await resp.json()));
1743
+ return new TextDecoder('utf-8').decode(b64ToBytes(b64FromApiJson(await resp.json())));
1742
1744
  }
1743
1745
  const appJs = await fetchGiteeFile(it.repo, it.appFile);
1744
1746
  b64 = b64FromApiJson(appJs);
1745
- return atob(b64);
1747
+ return new TextDecoder('utf-8').decode(b64ToBytes(b64));
1746
1748
  }
1747
1749
 
1748
1750
  // 安装一个新工具:下载内容 → 存入平台数据库 → 挂到对应模块
package/tools.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": 1,
3
- "platform": "1.1.21",
3
+ "platform": "1.1.22",
4
4
  "updatedAt": "2026-10-14",
5
5
  "note": "WWT 工作平台工具清单。新增/修改工具只需改这个文件并发布新版本,用户端自动同步,无需重新分发平台。",
6
6
  "tools": [