This commit is contained in:
Chuck1sn
2025-05-26 11:29:51 +08:00
parent 3f4a5f2e8b
commit 0b8624a098
10 changed files with 99 additions and 187 deletions

View File

@@ -69,17 +69,7 @@ const handleSubmit = async () => {
.min(5, "表达式的长度非法"),
});
try {
const validatedData = jobSchema.parse(formData.value);
await onSubmit(validatedData.cronExpression);
} catch (error) {
if (error instanceof z.ZodError) {
alertStore.showAlert({
level: "error",
content: error.errors[0].message,
});
}
throw error;
}
const validatedData = jobSchema.parse(formData.value);
await onSubmit(validatedData.cronExpression);
};
</script>