2.0阶段5: 设置页——服务状态/优雅重启(409确认强打+轮询health自动刷新)/config.yml表单化单项编辑(PATCH保留注释)/模型条目增删改/账号与MCP只读/YAML原文编辑器(干跑校验);GET /api/config增返effective
This commit is contained in:
@@ -39,7 +39,9 @@ async function req(method, url, body, isForm) {
|
||||
if (!res.ok) {
|
||||
let msg = 'HTTP ' + res.status;
|
||||
try { msg = (await res.json()).error || msg; } catch (_) {}
|
||||
throw new Error(msg);
|
||||
const err = new Error(msg);
|
||||
err.status = res.status; // 供调用方区分 409(重启保护/重名)等状态
|
||||
throw err;
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user