Skip to content

Commit 00303e7

Browse files
committed
feat: 调整 env backend 判断
1 parent 54b5cbd commit 00303e7

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.21.29",
3+
"version": "2.21.31",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/utils/env.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@ const {
1313
isGUIforCores,
1414
} = ENV();
1515
let backend = 'Node';
16-
if (isNode) backend = 'Node';
17-
if (isQX) backend = 'QX';
18-
if (isLoon) backend = 'Loon';
19-
if (isSurge) backend = 'Surge';
20-
if (isStash) backend = 'Stash';
21-
if (isShadowRocket) backend = 'Shadowrocket';
22-
if (isEgern) backend = 'Egern';
23-
if (isLanceX) backend = 'LanceX';
24-
if (isGUIforCores) backend = 'GUI.for.Cores';
16+
if (isNode) {
17+
backend = 'Node';
18+
} else if (isQX) {
19+
backend = 'QX';
20+
} else if (isLoon) {
21+
backend = 'Loon';
22+
} else if (isStash) {
23+
backend = 'Stash';
24+
} else if (isShadowRocket) {
25+
backend = 'Shadowrocket';
26+
} else if (isEgern) {
27+
backend = 'Egern';
28+
} else if (isSurge) {
29+
backend = 'Surge';
30+
} else if (isLanceX) {
31+
backend = 'LanceX';
32+
} else if (isGUIforCores) {
33+
backend = 'GUI.for.Cores';
34+
}
2535

2636
let meta = {};
2737
let feature = {};

backend/src/vendor/open-api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-undef */
22
const isQX = typeof $task !== 'undefined';
33
const isLoon = typeof $loon !== 'undefined';
4+
// 可能有一些兼容环境依赖于这个, 先不改成 $environment.surge-version
45
const isSurge = typeof $httpClient !== 'undefined' && !isLoon;
56
const isNode = eval(`typeof process !== "undefined"`); // eval is needed in order to avoid browserify processing
67
const isStash =

0 commit comments

Comments
 (0)