mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
fix: 修复代理 App 版中路由 target 参数为空的情况
This commit is contained in:
parent
e071a7f253
commit
6b23f82953
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.15.12",
|
"version": "2.16.0",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -14,27 +14,39 @@ import env from '@/utils/env';
|
|||||||
|
|
||||||
export default function register($app) {
|
export default function register($app) {
|
||||||
$app.get('/share/col/:name/:target', async (req, res) => {
|
$app.get('/share/col/:name/:target', async (req, res) => {
|
||||||
req.query.target = req.params.target;
|
const { target } = req.params;
|
||||||
$.info(`使用路由指定目标: ${req.params.target}`);
|
if (target) {
|
||||||
|
req.query.target = target;
|
||||||
|
$.info(`使用路由指定目标: ${target}`);
|
||||||
|
}
|
||||||
await downloadCollection(req, res);
|
await downloadCollection(req, res);
|
||||||
});
|
});
|
||||||
$app.get('/share/col/:name', downloadCollection);
|
$app.get('/share/col/:name', downloadCollection);
|
||||||
$app.get('/share/sub/:name/:target', async (req, res) => {
|
$app.get('/share/sub/:name/:target', async (req, res) => {
|
||||||
req.query.target = req.params.target;
|
const { target } = req.params;
|
||||||
$.info(`使用路由指定目标: ${req.params.target}`);
|
if (target) {
|
||||||
|
req.query.target = target;
|
||||||
|
$.info(`使用路由指定目标: ${target}`);
|
||||||
|
}
|
||||||
await downloadSubscription(req, res);
|
await downloadSubscription(req, res);
|
||||||
});
|
});
|
||||||
$app.get('/share/sub/:name', downloadSubscription);
|
$app.get('/share/sub/:name', downloadSubscription);
|
||||||
|
|
||||||
$app.get('/download/collection/:name/:target', async (req, res) => {
|
$app.get('/download/collection/:name/:target', async (req, res) => {
|
||||||
req.query.target = req.params.target;
|
const { target } = req.params;
|
||||||
$.info(`使用路由指定目标: ${req.params.target}`);
|
if (target) {
|
||||||
|
req.query.target = target;
|
||||||
|
$.info(`使用路由指定目标: ${target}`);
|
||||||
|
}
|
||||||
await downloadCollection(req, res);
|
await downloadCollection(req, res);
|
||||||
});
|
});
|
||||||
$app.get('/download/collection/:name', downloadCollection);
|
$app.get('/download/collection/:name', downloadCollection);
|
||||||
$app.get('/download/:name/:target', async (req, res) => {
|
$app.get('/download/:name/:target', async (req, res) => {
|
||||||
req.query.target = req.params.target;
|
const { target } = req.params;
|
||||||
$.info(`使用路由指定目标: ${req.params.target}`);
|
if (target) {
|
||||||
|
req.query.target = target;
|
||||||
|
$.info(`使用路由指定目标: ${target}`);
|
||||||
|
}
|
||||||
await downloadSubscription(req, res);
|
await downloadSubscription(req, res);
|
||||||
});
|
});
|
||||||
$app.get('/download/:name', downloadSubscription);
|
$app.get('/download/:name', downloadSubscription);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user