From 336ddd67064f2dddba1137654c42bf7494323c6c Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 29 Aug 2023 13:50:53 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/parsers/index.js | 1 - backend/src/core/proxy-utils/processors/index.js | 1 - backend/src/core/rule-utils/parsers.js | 2 +- backend/src/restful/miscs.js | 3 ++- backend/src/restful/settings.js | 14 +++++++++++--- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/backend/package.json b/backend/package.json index b0af73a34..2787255c2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.43", + "version": "2.14.44", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index cae041a3a..7211f4280 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -215,7 +215,6 @@ function URI_VMess() { // V2rayN URI format params = JSON.parse(content); } catch (e) { - // console.error(e); // Shadowrocket URI format // eslint-disable-next-line no-unused-vars let [__, base64Line, qs] = /(^[^?]+?)\/?\?(.*)$/.exec(line); diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index 4ff4c9383..d7b25a355 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -411,7 +411,6 @@ const DOMAIN_RESOLVERS = { }, }); const answers = resp.body.split(';').map((i) => i.split(',')[0]); - console.log(`answers`, answers); if (answers.length === 0) { throw new Error('No answers'); } diff --git a/backend/src/core/rule-utils/parsers.js b/backend/src/core/rule-utils/parsers.js index 51285bc31..7ec48a4e6 100644 --- a/backend/src/core/rule-utils/parsers.js +++ b/backend/src/core/rule-utils/parsers.js @@ -47,7 +47,7 @@ function AllRuleParser() { } if (!matched) throw new Error('Invalid rule type: ' + rawType); } catch (e) { - console.error(`Failed to parse line: ${line}\n Reason: ${e}`); + console.log(`Failed to parse line: ${line}\n Reason: ${e}`); } } return result; diff --git a/backend/src/restful/miscs.js b/backend/src/restful/miscs.js index ec3ffd351..139e52333 100644 --- a/backend/src/restful/miscs.js +++ b/backend/src/restful/miscs.js @@ -125,8 +125,9 @@ async function gistBackup(req, res) { $.cache = content; $.persistCache(); } - // perform migration after restoring from gist + $.info(`perform migration after restoring from gist...`); migrate(); + $.info(`migration completed`); $.info(`还原备份完成`); break; } diff --git a/backend/src/restful/settings.js b/backend/src/restful/settings.js index 3f44b2311..d8f9e7d60 100644 --- a/backend/src/restful/settings.js +++ b/backend/src/restful/settings.js @@ -44,8 +44,12 @@ export async function updateGitHubAvatar() { .then((resp) => JSON.parse(resp.body)); settings.avatarUrl = data['avatar_url']; $.write(settings, SETTINGS_KEY); - } catch (e) { - $.error('Failed to fetch GitHub avatar for User: ' + username); + } catch (err) { + $.error( + `Failed to fetch GitHub avatar for User: ${username}. Reason: ${ + err.message ?? err + }`, + ); } } } @@ -67,7 +71,11 @@ export async function updateArtifactStore() { $.write(settings, SETTINGS_KEY); } } catch (err) { - $.error('Failed to fetch artifact store for User: ' + githubUser); + $.error( + `Failed to fetch artifact store for User: ${githubUser}. Reason: ${ + err.message ?? err + }`, + ); } } }