refactor: 重构图片代理控制器,优化代码结构

This commit is contained in:
jiangrui
2025-02-24 16:10:46 +08:00
parent f5106e782a
commit f860cc1f57
2 changed files with 44 additions and 21 deletions

View File

@@ -3,6 +3,7 @@ import { sendSuccess, sendError } from "../utils/response";
import Searcher from "../services/Searcher";
import UserSetting from "../models/UserSetting";
import GlobalSetting from "../models/GlobalSetting";
import { iamgesInstance } from "./teleImages";
export const settingController = {
async get(req: Request, res: Response): Promise<void> {
@@ -45,6 +46,7 @@ export const settingController = {
await UserSetting.update(userSettings, { where: { userId } });
if (role === 1 && globalSetting) await GlobalSetting.update(globalSetting, { where: {} });
Searcher.updateAxiosInstance();
iamgesInstance.updateProxyConfig();
sendSuccess(res, {
message: "保存成功",
});