bun 多文件上传会有问题
This commit is contained in:
1
src/scripts/summary.md
Normal file
1
src/scripts/summary.md
Normal file
@@ -0,0 +1 @@
|
||||
# 汇总 23333
|
||||
24
src/scripts/upload.ts
Normal file
24
src/scripts/upload.ts
Normal 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();
|
||||
Reference in New Issue
Block a user