feat: collect editable scheduled batches and show order details in modals

This commit is contained in:
abaishu0730 committed 2026-10-26 09:53:45 +08:00
1 parent 8d010a05cd
commit c19be938fc
20 files changed
+212 -34

No files matched your search

+1
View File
@@ -40,6 +40,7 @@ function createAssets(){
'/field-mappings.css':{path:path.join(webRoot,'modules/field-mappings/view.css'),type:'text/css'},
'/order-notifications-shared.js':{path:path.join(webRoot,'modules/order-notifications/shared.js'),type:'text/javascript'},
'/modules/order-notifications/detail.js':{path:path.join(webRoot,'modules/order-notifications/detail.js'),type:'text/javascript'},
'/modules/order-notifications/batch-editor.js':{path:path.join(webRoot,'modules/order-notifications/batch-editor.js'),type:'text/javascript'},
'/modules/order-notifications/records.js':{path:path.join(webRoot,'modules/order-notifications/records.js'),type:'text/javascript'},
'/order-notifications.js':{path:path.join(webRoot,'modules/order-notifications/view.js'),type:'text/javascript'},
'/order-rules.js':{path:path.join(webRoot,'modules/order-rules/view.js'),type:'text/javascript'},
+1 -1
View File
@@ -14,7 +14,7 @@ async function readBody(request,fail){
let body;
if(request.method==='POST') {
if(!/^application\/json(?:;|$)/i.test(request.headers['content-type'] || ''))fail(415,'需要 JSON 数据。');
const mailEditor=/^\/api\/mail\/(?:templates(?:\/[\w-]+\/save)?|preview)(?:\?|$)/.test(request.url||''),mailAccount=/^\/api\/mail\/channels(?:\?|$)/.test(request.url||''),maxBytes=mailEditor?4*1024*1024:mailAccount?256*1024:128*1024;
const mailEditor=/^\/api\/mail\/(?:templates(?:\/[\w-]+\/save)?|preview)(?:\?|$)/.test(request.url||''),mailAccount=/^\/api\/mail\/channels(?:\?|$)/.test(request.url||''),batchEditor=/^\/api\/order-rules\/batches\/collecting-[a-f0-9]{32}\/content(?:\?|$)/.test(request.url||''),maxBytes=mailEditor||batchEditor?4*1024*1024:mailAccount?256*1024:128*1024;
if(Number(request.headers['content-length'] || 0)>maxBytes){request.resume();fail(413,'提交内容过大。');}
const chunks=[];let size=0;
for await(const chunk of request){size+=chunk.length;if(size>maxBytes)fail(413,'提交内容过大。');chunks.push(chunk);}