diff --git a/put/web/src/App.vue b/put/web/src/App.vue index ebb5964c..f7f699fe 100644 --- a/put/web/src/App.vue +++ b/put/web/src/App.vue @@ -6,6 +6,7 @@ 刷新配置数据 保存到服务器 导出 hexport.ts + 写入 heroSet.ts
@@ -288,6 +289,22 @@ async function doExport() { } } +async function doApply() { + try { + await ElMessageBox.confirm( + `将用 ${heroes.value.length} 个英雄直接覆盖 heroSet.ts 的英雄配置区域(@hero-setup:heroes-begin/end 标记之间),怪物配置不受影响。`, + '写入确认', + { confirmButtonText: '覆盖写入', cancelButtonText: '取消', type: 'warning' } + ) + } catch { return } + try { + const r = await api.applyHeroes(heroes.value) + ElMessage.success(`已写入 ${r.count} 个英雄 → ${r.path}`) + } catch (e) { + ElMessage.error('写入失败: ' + (e?.response?.data?.error || e.message)) + } +} + onMounted(() => { loadMeta() loadHeroes()