bun 多文件上传会有问题

This commit is contained in:
2025-05-11 21:57:54 +08:00
parent cdbebe92d0
commit 4aec2bc231
9 changed files with 510 additions and 691 deletions

1
src/scripts/summary.md Normal file
View File

@@ -0,0 +1 @@
# 汇总 23333

24
src/scripts/upload.ts Normal file
View File

@@ -0,0 +1,24 @@
import { fetchLink } from '@/module/download/install.ts';
import { baseURL, storage } from '@/module/query.ts';
import { upload } from '@/module/download/upload.ts';
import fs from 'node:fs';
import path from 'node:path';
const scriptPath = path.join(process.cwd(), 'src', 'scripts');
const sum = 'https://kevisual.xiongxiao.me/root/ai/kevisual/01-summary.md';
const download = async () => {
const { content } = await fetchLink(sum, { returnContent: true });
console.log(content.toString());
};
// download();
const uploadTest = async () => {
const file = fs.readFileSync(path.join(scriptPath, './summary.md'));
const token = storage.getItem('token');
// const res = await upload({ url: sum, file: '# 汇总 123', token });
const res = await upload({ url: sum, file: file, token });
console.log(res);
};
uploadTest();