From d23b640c64791e603a4845b4b0b7e8a9cb5464a0 Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 13 Jan 2026 10:27:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=97=B6=E7=A1=AE=E4=BF=9D=E5=90=8D=E7=A7=B0=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/restful/artifacts.js | 10 ++++++---- backend/src/restful/collections.js | 1 + backend/src/restful/file.js | 1 + backend/src/restful/subscriptions.js | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/package.json b/backend/package.json index 89c90381..0e21b3eb 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.20.82", + "version": "2.20.83", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/restful/artifacts.js b/backend/src/restful/artifacts.js index f1723978..5cb3c6f8 100644 --- a/backend/src/restful/artifacts.js +++ b/backend/src/restful/artifacts.js @@ -160,14 +160,16 @@ function createArtifact(req, res) { } function updateArtifact(req, res) { + let artifact = req.body; const allArtifacts = $.read(ARTIFACTS_KEY); let oldName = req.params.name; - const artifact = findByName(allArtifacts, oldName); - if (artifact) { - $.info(`正在更新远程配置:${artifact.name}`); + const oldArtifact = findByName(allArtifacts, oldName); + if (oldArtifact) { + if (!artifact.name) artifact.name = oldArtifact.name; + $.info(`正在更新远程配置:${oldArtifact.name}`); const newArtifact = { + ...oldArtifact, ...artifact, - ...req.body, }; if (!validateArtifactName(newArtifact.name)) { failed( diff --git a/backend/src/restful/collections.js b/backend/src/restful/collections.js index 852a1a80..6b3b55fc 100644 --- a/backend/src/restful/collections.js +++ b/backend/src/restful/collections.js @@ -87,6 +87,7 @@ function updateCollection(req, res) { const allCols = $.read(COLLECTIONS_KEY); const oldCol = findByName(allCols, name); if (oldCol) { + if (!collection.name) collection.name = oldCol.name; const newCol = { ...oldCol, ...collection, diff --git a/backend/src/restful/file.js b/backend/src/restful/file.js index 1ee2ba97..5a9c988d 100644 --- a/backend/src/restful/file.js +++ b/backend/src/restful/file.js @@ -267,6 +267,7 @@ function updateFile(req, res) { const allFiles = $.read(FILES_KEY); const oldFile = findByName(allFiles, name); if (oldFile) { + if (!file.name) file.name = oldFile.name; const newFile = { ...oldFile, ...file, diff --git a/backend/src/restful/subscriptions.js b/backend/src/restful/subscriptions.js index 35b50ce5..936a115b 100644 --- a/backend/src/restful/subscriptions.js +++ b/backend/src/restful/subscriptions.js @@ -298,6 +298,7 @@ function updateSubscription(req, res) { const allSubs = $.read(SUBS_KEY); const oldSub = findByName(allSubs, name); if (oldSub) { + if (!sub.name) sub.name = oldSub.name; const newSub = { ...oldSub, ...sub,