wwt-platform 1.1.9 → 1.1.10
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 +1 -1
- package/platform.html +14 -13
- package/tools.json +1 -1
package/package.json
CHANGED
package/platform.html
CHANGED
|
@@ -1357,7 +1357,7 @@ function doAddMod(){
|
|
|
1357
1357
|
// ═══════════════════════════════════════════════════════════
|
|
1358
1358
|
// 平台更新(方案B:平台 + 内置工具统一检查)
|
|
1359
1359
|
// ═══════════════════════════════════════════════════════════
|
|
1360
|
-
const PLATFORM_VER = '1.1.
|
|
1360
|
+
const PLATFORM_VER = '1.1.10';
|
|
1361
1361
|
const NPM_PKG = 'wwt-platform'; // NPM 包名(主力分发源)
|
|
1362
1362
|
const GITEE_TOKEN_KEY = 'wwt_gitee_token';
|
|
1363
1363
|
const GITEE_TOKEN_DEF = 'e45883b9c89b8d9689746ce42bbc2b0b';
|
|
@@ -1382,7 +1382,7 @@ const SOURCES = [
|
|
|
1382
1382
|
// 更新清单:每个条目 = 一个可更新对象(平台或工具)
|
|
1383
1383
|
// 这是「离线兜底种子」——联网时会与远程 tools.json 合并,远程为准
|
|
1384
1384
|
const UPD_REG_DEF = [
|
|
1385
|
-
{key:'platform', name:'WWT 工作平台', cur:'1.1.
|
|
1385
|
+
{key:'platform', name:'WWT 工作平台', cur:'1.1.10', repo:GITEE_PLATFORM_REPO, verFile:'version.js', appFile:'app.js', pat:'__WWT_PLATFORM_VER', kind:'platform'},
|
|
1386
1386
|
{key:'erp-recon', name:'ERP 对账工具', cur:'V1.0.2',repo:'wwtmrhu/erp-recon', verFile:'version.js', appFile:'app.js', pat:'__ERP_LATEST_VER'},
|
|
1387
1387
|
{key:'erp-tool', name:'ERP 对账单生成匹配', cur:'1.0.0', repo:'wwtmrhu/erp-tool', verFile:'version.js', appFile:'app.js', pat:'__ERP_LATEST_VER'},
|
|
1388
1388
|
{key:'voucher', name:'WWT 凭证工具', cur:'P1.2.12',repo:'wwtmrhu/certificate-generation', verFile:'dist/version.json', appFile:'', pat:'ver', appUrl:true}
|
|
@@ -1553,18 +1553,16 @@ let _manifestSrc = null; // 来源标签
|
|
|
1553
1553
|
let _newTools = []; // 清单里有、本平台还没装的工具
|
|
1554
1554
|
|
|
1555
1555
|
async function fetchManifest() {
|
|
1556
|
-
//
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
order = SOURCES.slice().sort((a, b) => verCmp(vers[b.id] || '0', vers[a.id] || '0'));
|
|
1562
|
-
} catch(e) { /* 取不到版本就按默认顺序试 */ }
|
|
1556
|
+
// 统一用「各源中的最高版本」去取清单。
|
|
1557
|
+
// 镜像的 /latest 常滞后,但它按版本号取文件是准的——所以不能用各源自己的版本号,
|
|
1558
|
+
// 否则会从镜像拉到旧清单。
|
|
1559
|
+
let target = null;
|
|
1560
|
+
try { target = (await bestVersion()).ver; } catch(e) { /* 取不到就逐源自查 */ }
|
|
1563
1561
|
|
|
1564
1562
|
const errs = [];
|
|
1565
|
-
for (const s of
|
|
1563
|
+
for (const s of SOURCES) {
|
|
1566
1564
|
try {
|
|
1567
|
-
const ver =
|
|
1565
|
+
const ver = target || (await sourceVersion(s));
|
|
1568
1566
|
const txt = await sourceFile(s, ver, 'tools.json');
|
|
1569
1567
|
const m = JSON.parse(txt);
|
|
1570
1568
|
if (!m || !Array.isArray(m.tools)) throw new Error('清单格式错误');
|
|
@@ -1995,17 +1993,20 @@ async function doUpdateOne(key) {
|
|
|
1995
1993
|
let bytes, srcLabel = '';
|
|
1996
1994
|
if (it.key === 'platform') {
|
|
1997
1995
|
// 平台本体:NPM 上直接是 platform.html(明文),Gitee 上是 base64 的 app.js
|
|
1996
|
+
// 用「各源中的最高版本」下载,避免镜像滞后导致下到旧版
|
|
1997
|
+
let target = null;
|
|
1998
|
+
try { target = (await bestVersion()).ver; } catch(e) {}
|
|
1998
1999
|
const res = await trySources(async (s) => {
|
|
1999
2000
|
if (s.id === 'gitee') {
|
|
2000
2001
|
const appJs = await fetchGiteeFile(GITEE_PLATFORM_REPO, 'app.js');
|
|
2001
2002
|
return { bytes: b64ToBytes(b64FromApiJson(appJs)) };
|
|
2002
2003
|
}
|
|
2003
|
-
const ver = await sourceVersion(s);
|
|
2004
|
+
const ver = target || (await sourceVersion(s));
|
|
2004
2005
|
const html = await sourceFile(s, ver, 'platform.html');
|
|
2005
2006
|
return { bytes: new TextEncoder().encode(html) };
|
|
2006
2007
|
});
|
|
2007
2008
|
bytes = res.val.bytes;
|
|
2008
|
-
srcLabel = res.label;
|
|
2009
|
+
srcLabel = res.label + (target ? ' v' + target : '');
|
|
2009
2010
|
} else if (it.appUrl) {
|
|
2010
2011
|
// version.json 里直接带最新版文件 API 地址,按 url 字段下载
|
|
2011
2012
|
const vc = await fetchGiteeFile(it.repo, it.verFile);
|