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 }, }