更新依赖项,使用 Busboy 替代 formidable 处理文件上传,优化上传逻辑,改进权限检查

This commit is contained in:
2025-12-21 06:41:27 +08:00
parent 15fcfdad18
commit 8a633feb4f
12 changed files with 344 additions and 155 deletions

View File

@@ -2,7 +2,6 @@ import { router } from '@/app.ts';
import http from 'http';
import { useContextKey } from '@kevisual/context';
import { checkAuth, error } from './middleware/auth.ts';
import formidable from 'formidable';
export { router, checkAuth, error };
/**
@@ -68,7 +67,7 @@ export const deleteOldClients = () => {
* @param parseKeys 需要解析的键
* @returns 解析后的数据
*/
export const getKey = (fields: formidable.Fields<string>, parseKeys: string[]) => {
export const getKey = (fields: Record<string, any>, parseKeys: string[]) => {
let value: Record<string, any> = {};
for (const key of parseKeys) {
const v = fields[key];