mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 05:05:44 +08:00
Introduces backend API and router for updating NapCat, including update logic and pending update application on startup. Adds frontend integration with update button and request handling. Refactors system info component to remove legacy new version tip. Updates types and runtime to track working environment for update selection. Implements lazy loading for pty in unixTerminal to avoid early initialization.
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
/**
|
|
* @file 所有路由的入口文件
|
|
*/
|
|
|
|
import { Router } from 'express';
|
|
|
|
import { OB11ConfigRouter } from '@/napcat-webui-backend/src/router/OB11Config';
|
|
import { auth } from '@/napcat-webui-backend/src/middleware/auth';
|
|
import { sendSuccess } from '@/napcat-webui-backend/src/utils/response';
|
|
|
|
import { QQLoginRouter } from '@/napcat-webui-backend/src/router/QQLogin';
|
|
import { AuthRouter } from '@/napcat-webui-backend/src/router/auth';
|
|
import { LogRouter } from '@/napcat-webui-backend/src/router/Log';
|
|
import { BaseRouter } from '@/napcat-webui-backend/src/router/Base';
|
|
import { FileRouter } from './File';
|
|
import { WebUIConfigRouter } from './WebUIConfig';
|
|
import { UpdateNapCatRouter } from './UpdateNapCat';
|
|
|
|
const router = Router();
|
|
|
|
// 鉴权中间件
|
|
router.use(auth);
|
|
|
|
// router:测试用
|
|
router.all('/test', (_, res) => {
|
|
return sendSuccess(res);
|
|
});
|
|
// router:基础信息相关路由
|
|
router.use('/base', BaseRouter);
|
|
// router:WebUI登录相关路由
|
|
router.use('/auth', AuthRouter);
|
|
// router:QQ登录相关路由
|
|
router.use('/QQLogin', QQLoginRouter);
|
|
// router:OB11配置相关路由
|
|
router.use('/OB11Config', OB11ConfigRouter);
|
|
// router:日志相关路由
|
|
router.use('/Log', LogRouter);
|
|
// file:文件相关路由
|
|
router.use('/File', FileRouter);
|
|
// router:WebUI配置相关路由
|
|
router.use('/WebUIConfig', WebUIConfigRouter);
|
|
// router:更新NapCat相关路由
|
|
router.use('/UpdateNapCat', UpdateNapCatRouter);
|
|
|
|
export { router as ALLRouter };
|