feat: 添加测试更新相关代码

This commit is contained in:
539943419 committed 2025-01-15 20:14:42 +08:00
1 parent 24f910e12c
commit f4e4d8c8f7
4 files changed
+53 -1

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import fs from 'fs';
export default defineEventHandler(async (event) => {
const data = await readFormData(event)
const file = data.get('file') as File
const buffer = await file.arrayBuffer()
const uint8Array = new Uint8Array(buffer)
fs.writeFileSync('./userData/test.txt', uint8Array, {
flag: 'w',
})
return {
status: 200,
}
})