feat(web): 搭建应用骨架并完善开发环境配置
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import type { Rule } from 'antd/es/form';
|
||||
|
||||
/** 邮箱格式校验:仅在非空时校验,避免与 required 规则在空值时同时报错(antd v6 行为) */
|
||||
export const emailFormatRule: Rule = {
|
||||
validator: (_, value: string) =>
|
||||
!value || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)
|
||||
? Promise.resolve()
|
||||
: Promise.reject(new Error('邮箱格式不正确')),
|
||||
};
|
||||
Reference in New Issue
Block a user