Skip to content

Commit

Permalink
feat: 添加域名输入校验
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoopv committed Apr 9, 2022
1 parent 2d45c5b commit 0dcf6f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ const App = () => {
required: true,
message: "必须输入域名!",
},
{
pattern: /[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+/,
message: "域名格式不正确"
}
]}
>
<Input placeholder="输入域名" size="large" autoFocus />
Expand Down

0 comments on commit 0dcf6f6

Please sign in to comment.