Add readonly todo and archive providers and retire legacy writes

This commit is contained in:
abaishu0730 committed 2026-10-19 12:43:03 +08:00
1 parent 37b4a156c9
commit 5c7ce76f5d
12 files changed
+187 -25

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ const handled=(...args)=>{reply(...args);return true;};
}
if(route==='/api/settings') {
if(request.method==='GET')return handled(200,store.settings());
if(request.method==='POST'){if(user.role!=='admin')fail(403,'仅管理员可以修改配置。');return handled(200,store.saveSettings(body,body.version,user.username));}
if(request.method==='POST'){if(user.role!=='admin')fail(403,'仅管理员可以修改配置。');if(Object.hasOwn(body,'groups')||Object.hasOwn(body,'templates'))fail(410,'旧群组与通用模板写入已停用,请在分类规则维护收件人,在邮件模板维护类别关联。');return handled(200,store.saveSettings({...body,schedule:{...store.settings().schedule,...body.schedule}},body.version,user.username));}
}
if(route==='/api/jobs' && request.method==='GET')return handled(200,{jobs:store.jobs().map(publicJob)});
if(route==='/api/audit' && request.method==='GET')return handled(200,{audit:store.audit()});