fix: music proxy
This commit is contained in:
1 parent
cbc86e9e04
commit
5ffef9aafa
4 files changed
+30
-7
No files matched your search
@@ -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参数不合法'));
|
||||
}
|
||||
};
|
||||
@@ -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 };
|
||||
Reference in new issue
Block a user