@zaofan/dsh-qqbot 1.11.20 → 1.11.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/client/qqbot-settings.js +3 -3
- package/package.json +1 -1
- package/settings-host.js +37 -2
package/client/qqbot-settings.js
CHANGED
|
@@ -7675,12 +7675,12 @@ var QQS_THEME_CSS = [
|
|
|
7675
7675
|
? h('span', { className: 'qqs-mk-tag' }, canUpdate ? ('已装 v' + localVer) : '已安装')
|
|
7676
7676
|
: null,
|
|
7677
7677
|
canUpdate
|
|
7678
|
-
? h('button', { className: 'qqs-mk-btn', disabled: busy, onClick: function () { onInstall({ id: id }) } },
|
|
7678
|
+
? h('button', { type: 'button', className: 'qqs-mk-btn', disabled: busy, onClick: function () { onInstall({ id: id }) } },
|
|
7679
7679
|
busy ? '更新中…' : ('更新到 v' + remoteVer))
|
|
7680
7680
|
: null,
|
|
7681
7681
|
isIn
|
|
7682
|
-
? h('button', { className: 'qqs-mk-ghost', disabled: busy, onClick: function () { onRemove({ id: id }) } }, busy ? '处理中…' : '卸载')
|
|
7683
|
-
: (canUpdate ? null : h('button', { className: 'qqs-mk-btn', disabled: busy, onClick: function () { onInstall({ id: id }) } }, busy ? '安装中…' : '安装')))),
|
|
7682
|
+
? h('button', { type: 'button', className: 'qqs-mk-ghost', disabled: busy, onClick: function () { onRemove({ id: id }) } }, busy ? '处理中…' : '卸载')
|
|
7683
|
+
: (canUpdate ? null : h('button', { type: 'button', className: 'qqs-mk-btn', disabled: busy, onClick: function () { onInstall({ id: id }) } }, busy ? '安装中…' : '安装')))),
|
|
7684
7684
|
p.description ? h('div', { className: 'qqs-mk-desc', style: S2.cardDesc }, String(p.description)) : null,
|
|
7685
7685
|
(p.tags && p.tags.length)
|
|
7686
7686
|
? h('div', { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } },
|
package/package.json
CHANGED
package/settings-host.js
CHANGED
|
@@ -795,7 +795,23 @@ export function apply(ctx) {
|
|
|
795
795
|
for (const b of list) {
|
|
796
796
|
const cfg = b.cfg || {};
|
|
797
797
|
if (cfg.dataRoot) return String(cfg.dataRoot);
|
|
798
|
-
if (cfg.cwd) return join(String(cfg.cwd), 'dshqqbot'); // 与 DEFAULT_DATA_SUBDIR 一致
|
|
798
|
+
if (cfg.cwd) return join(absCwd(cfg.cwd) || String(cfg.cwd), 'dshqqbot'); // 与 DEFAULT_DATA_SUBDIR 一致
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// ★ 2026-10-30 修 issue #33:**实例没写 cwd/dataRoot 时也要能推出来**。
|
|
802
|
+
// 插件侧 src/gateway/data-root.ts 的默认口径是
|
|
803
|
+
// dataRoot = config.dataRoot || {absCwd(config.cwd) || process.cwd()}/dshqqbot
|
|
804
|
+
// 也就是说 patch 里不写 cwd,插件照样在 {process.cwd()}/dshqqbot 下建数据。
|
|
805
|
+
// 以前桥这边只认"显式写出"的 cwd ⇒ 返回空 ⇒ qun/* 全部报「推不出数据根」
|
|
806
|
+
// (现象:群管理的二维码/踢人/成员列表在简配实例上完全不可用),而 market/* 走
|
|
807
|
+
// resolveDataRootForWorkspace() 有完整兜底,所以看起来"市场能用、群管理坏了"。
|
|
808
|
+
// 这里补上同一套保守兜底:只在**确实存在启用中的实例**时返回默认根,
|
|
809
|
+
// 一个实例都没有仍然返回空(面板不该替用户凭空造数据根)。
|
|
810
|
+
const enabled = bots.filter((b) => b && !b.disabled && b.cfg);
|
|
811
|
+
if (enabled.length) {
|
|
812
|
+
const first = enabled[0].cfg || {};
|
|
813
|
+
const base = absCwd(first.cwd) || process.cwd();
|
|
814
|
+
return join(base, 'dshqqbot');
|
|
799
815
|
}
|
|
800
816
|
} catch { /* 推不出来就交给 ensurePath 兜底 */ }
|
|
801
817
|
return '';
|
|
@@ -1185,6 +1201,23 @@ export function apply(ctx) {
|
|
|
1185
1201
|
i += 1;
|
|
1186
1202
|
}
|
|
1187
1203
|
}
|
|
1204
|
+
// ★ 2026-10-30 修 issue #33(同类问题一次收口):
|
|
1205
|
+
// patch 里**没写** cwd/dataRoot 的实例,解析结果里 cwd 一直是空,
|
|
1206
|
+
// 而下游一大票路由都是 `bot.cfg.dataRoot || bot.cwd` ⇒ 全拿到空串
|
|
1207
|
+
// (qun/* 报「推不出数据根」;导出、图库、群台账、join-pending… 同理)。
|
|
1208
|
+
// 这里按插件 src/gateway/data-root.ts 的口径补默认值:
|
|
1209
|
+
// dataRoot || {absCwd(cfg.cwd) || process.cwd()}/dshqqbot
|
|
1210
|
+
// ⚠️ bot.cwd 的历史语义就是【数据根】,不是工作目录(cfg.cwd 才是工作目录)。
|
|
1211
|
+
for (const b of bots) {
|
|
1212
|
+
if (!b) continue;
|
|
1213
|
+
const cfg = b.cfg || {};
|
|
1214
|
+
if (b.cwd) continue;
|
|
1215
|
+
try {
|
|
1216
|
+
b.cwd = cfg.dataRoot
|
|
1217
|
+
? String(cfg.dataRoot)
|
|
1218
|
+
: join(absCwd(cfg.cwd) || process.cwd(), 'dshqqbot');
|
|
1219
|
+
} catch { b.cwd = ''; }
|
|
1220
|
+
}
|
|
1188
1221
|
return { raw, hasFile, bots };
|
|
1189
1222
|
}
|
|
1190
1223
|
/** 从磁盘读取并解析(parsePatchFrom 的包装) */
|
|
@@ -6650,7 +6683,9 @@ const WHY_MAP = { busy: '目标会话回合活跃,已等待至回合结束仍超
|
|
|
6650
6683
|
} catch (e) {
|
|
6651
6684
|
uiSeeded = { error: e instanceof Error ? e.message : String(e) };
|
|
6652
6685
|
}
|
|
6653
|
-
|
|
6686
|
+
// 2026-10-30 修 issue #32:这里原本写 files.length,但作用域里只有 list(files 根本不存在)
|
|
6687
|
+
// ⇒ ReferenceError 被外层 catch 成 500 ⇒「文件已写入却提示安装失败、卡片也不变已安装」。
|
|
6688
|
+
writeJson(res, 200, { ok: written > 0, written, total: list.length, failed, dest, uiSeeded });
|
|
6654
6689
|
} catch (e) {
|
|
6655
6690
|
writeJson(res, 500, { ok: false, error: String((e && e.message) || e) });
|
|
6656
6691
|
}
|