shaogen1995 1 年之前
父節點
當前提交
214cd8ab70
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/pages/Layout/index.tsx

+ 3 - 0
src/pages/Layout/index.tsx

@@ -211,6 +211,7 @@ function Layout() {
             label="旧密码"
             name="oldPassword"
             rules={[{ required: true, message: "不能为空!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")} 
           >
             <Input.Password maxLength={20} />
           </Form.Item>
@@ -222,6 +223,7 @@ function Layout() {
               { required: true, message: "不能为空!" },
               { min: 6, max: 15, message: "密码长度为6-15个字符!" },
             ]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
           >
             <Input.Password
               maxLength={15}
@@ -233,6 +235,7 @@ function Layout() {
             label="确定新密码"
             name="checkPass"
             rules={[{ validator: checkPassWord }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
           >
             <Input.Password maxLength={15} />
           </Form.Item>