From 4b40560a806ae8a914b6e94006e6a4de64792a37 Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Mon, 22 Sep 2025 23:00:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E4=BA=AB=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8=E5=90=8E=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=8A/=E4=B8=8B=E4=B8=80=E4=B8=AA=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=97=B6=E4=BB=8D=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E3=80=81=E6=97=A0=E6=B3=95=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=85=B6=E4=BB=96=E8=B5=84=E6=BA=90=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 切换资源时清理 error/fileList/paths,重置到选择目录界面 - 链接基础部分变化时清空 stoken 强制刷新 - getShareDetail 调用前清空错误状态,避免残留覆盖新资源展示 --- app/templates/index.html | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/app/templates/index.html b/app/templates/index.html index 5f0b19d..7fc52c0 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -8112,6 +8112,23 @@ this.smart_param.currentResourceIndex--; const previousResource = this.smart_param.taskSuggestions.data[this.smart_param.currentResourceIndex]; if (previousResource) { + // 在切换资源时,重置展示相关状态,避免错误提示残留 + this.fileSelect.error = undefined; + this.fileSelect.fileList = []; + this.fileSelect.paths = []; + // 确保处于“选择需转存的文件夹”界面 + this.fileSelect.previewRegex = false; + this.fileSelect.selectDir = true; + // 如果基础链接变化,清空stoken强制刷新 + try { + const oldBase = this.getShareurl(this.fileSelect.shareurl); + const newBase = this.getShareurl(previousResource.shareurl); + if (oldBase !== newBase) { + this.fileSelect.stoken = ""; + } + } catch (e) { + this.fileSelect.stoken = ""; + } // 更新当前分享链接并重新加载内容 this.fileSelect.shareurl = previousResource.shareurl; this.getShareDetail(0, 1); @@ -8124,6 +8141,23 @@ this.smart_param.currentResourceIndex++; const nextResource = this.smart_param.taskSuggestions.data[this.smart_param.currentResourceIndex]; if (nextResource) { + // 在切换资源时,重置展示相关状态,避免错误提示残留 + this.fileSelect.error = undefined; + this.fileSelect.fileList = []; + this.fileSelect.paths = []; + // 确保处于“选择需转存的文件夹”界面 + this.fileSelect.previewRegex = false; + this.fileSelect.selectDir = true; + // 如果基础链接变化,清空stoken强制刷新 + try { + const oldBase = this.getShareurl(this.fileSelect.shareurl); + const newBase = this.getShareurl(nextResource.shareurl); + if (oldBase !== newBase) { + this.fileSelect.stoken = ""; + } + } catch (e) { + this.fileSelect.stoken = ""; + } // 更新当前分享链接并重新加载内容 this.fileSelect.shareurl = nextResource.shareurl; this.getShareDetail(0, 1); @@ -8370,6 +8404,8 @@ } }, getShareDetail(retryCount = 0, maxRetries = 1) { + // 切换或重试前清理残留错误提示,避免覆盖新资源展示 + this.fileSelect.error = undefined; this.modalLoading = true; // 检查index是否有效,如果无效则使用默认值