feat(service): 新增Wintopay物流服务并优化订单导出和物流处理 #70

Merged
longbot merged 8 commits from zhuotianyuan/API:main into main 2026-01-30 07:20:08 +00:00
4 changed files with 63 additions and 61 deletions
Showing only changes of commit e30cce45b7 - Show all commits

View File

@ -1205,10 +1205,12 @@ public async fetchMediaPaged(site: any, params: Partial<WpMediaGetListParams> =
throw new Error('source_url 不存在'); throw new Error('source_url 不存在');
} }
// 下载源文件为 Buffer // 下载源文件为 Buffer
const resp = await axios.get(srcUrl, { responseType: 'arraybuffer', timeout: 30000, const resp = await axios.get(srcUrl, {
responseType: 'arraybuffer', timeout: 30000,
headers: { headers: {
'User-Agent': 'Mozilla/5.0 (compatible; Node.js Axios)', 'User-Agent': 'Mozilla/5.0 (compatible; Node.js Axios)',
} }); }
});
const inputBuffer = Buffer.from(resp.data); const inputBuffer = Buffer.from(resp.data);
// 条件判断 如果下载的 Buffer 为空则抛出错误 // 条件判断 如果下载的 Buffer 为空则抛出错误
if (!inputBuffer || inputBuffer.length === 0) { if (!inputBuffer || inputBuffer.length === 0) {