mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 03:09:03 +08:00
release: backend version 2.14.184
This commit is contained in:
parent
31b48d7a6c
commit
ca0d800bbb
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.183",
|
||||
"version": "2.14.184",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -6,6 +6,12 @@ export default function register($app) {
|
||||
$app.route('/api/proxy/parse').post(proxy_parser);
|
||||
$app.route('/api/rule/parse').post(rule_parser);
|
||||
}
|
||||
|
||||
/***
|
||||
* 感谢 izhangxm 的 PR!
|
||||
* 目前没有节点操作, 没有支持完整参数, 以后再完善一下
|
||||
*/
|
||||
|
||||
/***
|
||||
* 代理服务器协议转换接口。
|
||||
* 请求方法为POST,数据为json。需要提供data和client字段。
|
||||
@ -14,14 +20,15 @@ export default function register($app) {
|
||||
*
|
||||
*/
|
||||
function proxy_parser(req, res) {
|
||||
const { data, client } = req.body;
|
||||
const { data, client, content, platform } = req.body;
|
||||
var result = {};
|
||||
try {
|
||||
var proxies = ProxyUtils.parse(data);
|
||||
var par_res = ProxyUtils.produce(proxies, client);
|
||||
var proxies = ProxyUtils.parse(data ?? content);
|
||||
var par_res = ProxyUtils.produce(proxies, client ?? platform);
|
||||
result['par_res'] = par_res;
|
||||
} catch (err) {
|
||||
failed(res, err);
|
||||
return;
|
||||
}
|
||||
success(res, result);
|
||||
}
|
||||
@ -32,14 +39,15 @@ function proxy_parser(req, res) {
|
||||
* client: string, 目标平台名称,具体见backend/src/core/rule-utils/producers.js
|
||||
*/
|
||||
function rule_parser(req, res) {
|
||||
const { data, client } = req.body;
|
||||
const { data, client, content, platform } = req.body;
|
||||
var result = {};
|
||||
try {
|
||||
const rules = RuleUtils.parse(data);
|
||||
var par_res = RuleUtils.produce(rules, client);
|
||||
const rules = RuleUtils.parse(data ?? content);
|
||||
var par_res = RuleUtils.produce(rules, client ?? platform);
|
||||
result['par_res'] = par_res;
|
||||
} catch (err) {
|
||||
failed(res, err);
|
||||
return;
|
||||
}
|
||||
|
||||
success(res, result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user