Skip to content

Commit 54750d5

Browse files
committed
feat: 为 env 响应增加如何使用前端搭配后端的引导说明
1 parent 0e7561a commit 54750d5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
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.19.49",
3+
"version": "2.19.51",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/restful/miscs.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,19 @@ function getEnv(req, res) {
7777
if (req.query.share) {
7878
env.feature.share = true;
7979
}
80-
success(res, env);
80+
res.set('Content-Type', 'application/json;charset=UTF-8').send(
81+
JSON.stringify(
82+
{
83+
status: 'success',
84+
data: {
85+
guide: '⚠️⚠️⚠️ 您当前看到的是后端的响应. 若想配合前端使用, 可访问官方前端 https://sub-store.vercel.app 后自行配置后端地址, 或一键配置后端 https://sub-store.vercel.app?api=https://a.com/xxx (假设 https://a.com 是你后端的域名, /xxx 是自定义路径). 需注意 HTTPS 前端无法请求非本地的 HTTP 后端(部分浏览器上也无法访问本地 HTTP 后端). 请配置反代或在局域网自建 HTTP 前端. 如果还有问题, 可查看此排查说明: https://t.me/zhetengsha/1068',
86+
...env,
87+
},
88+
},
89+
null,
90+
2,
91+
),
92+
);
8193
}
8294

8395
async function refresh(_, res) {

0 commit comments

Comments
 (0)