fix: music proxy
Build Release / check-version (push) Canceled after 0s
Build Release / Build-LiteLoader (push) Canceled after 0s
Build Release / Build-Shell (push) Canceled after 0s
Build Release / release-napcat (push) Canceled after 0s
Build Action / Build-LiteLoader (push) Canceled after 0s
Build Action / Build-Shell (push) Canceled after 0s

This commit is contained in:
手瓜一十雪 committed 2025-01-25 18:34:11 +08:00
1 parent c474158a09
commit 49234ea5c7
4 files changed
+30 -7

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import { RequestHandler } from "express";
import { RequestUtil } from "@/common/request";
import { sendError, sendSuccess } from "../utils/response";
export const GetProxyHandler: RequestHandler = async (req, res) => {
let { url } = req.query;
if (url && typeof url === "string") {
url = decodeURIComponent(url);
const responseText = await RequestUtil.HttpGetText(url);
res.send(sendSuccess(res, responseText));
} else {
res.send(sendError(res, 'url参数不合法'));
}
};
+2 -1
View File
@@ -1,11 +1,12 @@
import { Router } from 'express';
import { PackageInfoHandler, QQVersionHandler } from '../api/BaseInfo';
import { StatusRealTimeHandler } from "@webapi/api/Status";
import { GetProxyHandler } from '../api/Proxy';
const router = Router();
// router: 获取nc的package.json信息
router.get('/QQVersion', QQVersionHandler);
router.get('/PackageInfo', PackageInfoHandler);
router.get('/GetSysStatusRealTime', StatusRealTimeHandler);
router.get('/proxy', GetProxyHandler);
export { router as BaseRouter };