From 949044fcdbcdec4e28a524b6183c747e6d7ea2ad Mon Sep 17 00:00:00 2001 From: AoXuan Date: Tue, 2 Sep 2025 20:46:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=88=9B=E5=BB=BA=E6=97=B6=EF=BC=8C=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=B2=A1=E6=9C=89=E8=A2=AB=E6=AD=A3=E7=A1=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=EF=BC=9B=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=94=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E7=94=A8=E6=88=B7=E6=B7=BB=E5=8A=A0=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Scripts.vue | 13 ++----------- frontend/src/views/UserEdit.vue | 14 +++++++++++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/frontend/src/views/Scripts.vue b/frontend/src/views/Scripts.vue index adde1fd..0437428 100644 --- a/frontend/src/views/Scripts.vue +++ b/frontend/src/views/Scripts.vue @@ -451,17 +451,8 @@ const handleConfirmTemplate = async () => { // 刷新脚本列表 await loadScripts() - // 跳转到编辑页面 - router.push({ - path: `/scripts/${createResult.scriptId}/edit`, - state: { - scriptData: { - id: createResult.scriptId, - type: 'General', - config: createResult.data, - }, - }, - }) + // 跳转到编辑页面,不传递state数据,让编辑页面从API重新加载最新配置 + router.push(`/scripts/${createResult.scriptId}/edit`) } } catch (error) { console.error('使用模板创建脚本失败:', error) diff --git a/frontend/src/views/UserEdit.vue b/frontend/src/views/UserEdit.vue index 9624d62..bd5bbee 100644 --- a/frontend/src/views/UserEdit.vue +++ b/frontend/src/views/UserEdit.vue @@ -902,7 +902,8 @@ 启用后将发送任务通知 - + + 通知内容 @@ -1128,7 +1129,6 @@ const getDefaultGeneralUserData = () => ({ ToAddress: '', IfSendMail: false, IfSendStatistic: false, - IfSendSixStar: false, IfServerChan: false, IfCompanyWebHookBot: false, ServerChanKey: '', @@ -1322,10 +1322,18 @@ const handleSubmit = async () => { const { InfrastPath, ...infoWithoutInfrastPath } = formData.Info // 构建提交数据 + let notifyData = { ...formData.Notify } + + // 如果是通用脚本,移除MAA专用的通知字段 + if (scriptType.value === 'General') { + const { IfSendSixStar, ...generalNotify } = notifyData + notifyData = generalNotify + } + const userData = { Info: { ...infoWithoutInfrastPath }, Task: { ...formData.Task }, - Notify: { ...formData.Notify }, + Notify: notifyData, Data: { ...formData.Data }, }