更新依赖项,使用 Busboy 替代 formidable 处理文件上传,优化上传逻辑,改进权限检查
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user