feat: 分享支持多一级路由指定输出目标

This commit is contained in:
xream 2024-12-29 22:08:24 +08:00
parent ff4be7ac38
commit 8090d678ee
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.15.9",
"version": "2.15.10",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@ -13,7 +13,17 @@ import { getISO } from '@/utils/geo';
import env from '@/utils/env';
export default function register($app) {
$app.get('/share/col/:name/:target', async (req, res) => {
req.query.target = req.params.target;
$.info(`使用路由指定目标: ${req.params.target}`);
await downloadCollection(req, res);
});
$app.get('/share/col/:name', downloadCollection);
$app.get('/share/sub/:name/:target', async (req, res) => {
req.query.target = req.params.target;
$.info(`使用路由指定目标: ${req.params.target}`);
await downloadSubscription(req, res);
});
$app.get('/share/sub/:name', downloadSubscription);
$app.get('/download/collection/:name/:target', async (req, res) => {