Refactor type annotations and router initialization
Standardized type annotations for interfaces in user.ts and improved type safety in webapi.ts. Updated all Express router initializations to explicitly declare the Router type. Added missing RequestHandler typings in uploader modules for better type checking.
This commit is contained in:
1 parent
772f07c58b
commit
01958d47a4
16 files changed
+123
-121
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import multer from 'multer';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import type { Request, Response } from 'express';
|
||||
import type { Request, Response, RequestHandler } from 'express';
|
||||
import { WebUiConfig } from '@/napcat-webui-backend/index';
|
||||
|
||||
// 支持的字体格式
|
||||
@@ -42,7 +42,7 @@ export const webUIFontStorage = multer.diskStorage({
|
||||
},
|
||||
});
|
||||
|
||||
export const webUIFontUpload = multer({
|
||||
export const webUIFontUpload: RequestHandler = multer({
|
||||
storage: webUIFontStorage,
|
||||
fileFilter: (_, file, cb) => {
|
||||
// 验证文件类型
|
||||
|
||||
Reference in new issue
Block a user