【修复】邮箱初始化问题

This commit is contained in:
cai
2026-01-14 18:55:54 +08:00
parent a8c4a6766f
commit 0a8b4e13fc
51 changed files with 73 additions and 71 deletions

View File

@@ -155,12 +155,25 @@ export default defineComponent({
}))
.filter((item) => item.email) || [];
// 检查是否为编辑模式且有外部传入的邮箱
if (isEdit.value && routeEmail.value) {
// 编辑模式:使用外部传入的邮箱地址
param.value.email = routeEmail.value;
// 检查是否为编辑模式
if (isEdit.value) {
// 编辑模式:检查是否需要使用外部传入的邮箱
if (routeEmail.value) {
// 使用外部传入的邮箱地址
param.value.email = routeEmail.value;
// 尝试在选项中找到对应的 eabId
const matchedOption = emailOptions.value.find(
(item) => item.email === routeEmail.value
);
if (matchedOption) {
param.value.eabId = matchedOption.id.toString();
} else {
param.value.eabId = "";
}
}
// 如果没有外部传入的邮箱,保持原有的 email 和 eabId 不变
} else {
// 非编辑模式:保持原有逻辑
// 非编辑模式:自动填充第一个邮箱
if (!emailOptions.value.length) {
param.value.email = "";
param.value.eabId = "";

View File

@@ -467,27 +467,6 @@ export default defineComponent({
},
)
// 监听 provider 变化,重置配置模式和跳过选项
watch(
() => param.value.provider,
(newProvider, oldProvider) => {
if (newProvider !== oldProvider) {
// 重置配置模式为默认
configMode.value = 'default'
param.value.configMode = 'default'
// 重置跳过选项为 true (1)
param.value.skip = 1
// 如果是插件类型,清空插件相关字段
if (newProvider !== 'plugin') {
param.value.action = ''
param.value.params = {}
currentDynamicParams.value = []
pluginActionOptions.value = []
}
}
},
)
// 监听配置模式变化处理params数据格式转换
watch(
() => configMode.value,
@@ -745,6 +724,12 @@ export default defineComponent({
// else {
// param.value.provider_id = props.node.config.provider_id
// }
// 初始化配置模式和跳过开关为默认值
configMode.value = 'default'
param.value.configMode = 'default'
param.value.skip = 1
// 加载证书来源选项
certOptions.value = findApplyUploadNodesUp(props.node.id).map((item) => {
return { label: item.name, value: item.id }