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

@@ -86,18 +86,8 @@ const handleSubmit = async () => {
.max(15, "权限代码最多15个字符"),
});
try {
const validatedData = permissionSchema.parse(formData.value);
await onSubmit(validatedData);
updateFormData(undefined);
} catch (error) {
if (error instanceof z.ZodError) {
alertStore.showAlert({
level: "error",
content: error.errors[0].message,
});
}
throw error;
}
const validatedData = permissionSchema.parse(formData.value);
await onSubmit(validatedData);
updateFormData(undefined);
};
</script>