liqiuying пре 2 месеци
родитељ
комит
e5328db5f3
1 измењених фајлова са 19 додато и 18 уклоњено
  1. 19 18
      entrypoints/popup/pages/Login.tsx

+ 19 - 18
entrypoints/popup/pages/Login.tsx

@@ -10,7 +10,7 @@ export default function Login({ setIsLoggedIn }: { setIsLoggedIn: (loggedIn: boo
     const formRef = useRef<any>(null);
     const [username, setUsername] = useState('');
     const [password, setPassword] = useState('');
-    const [invitationCode, setInvitationCode] = useState('');
+    // const [invitationCode, setInvitationCode] = useState('');
     const [loading, setLoading] = useState(false);
     const [errors, setErrors] = useState<{ username?: string, password?: string, code?: string, invitationCode?: string }>({});
     const [keys, setKeys] = useState('');
@@ -44,9 +44,9 @@ export default function Login({ setIsLoggedIn }: { setIsLoggedIn: (loggedIn: boo
         }
 
         // 添加邀请码校验
-        if (!invitationCode.trim()) {
-            newErrors.invitationCode = '请输入邀请码';
-        }
+        // if (!invitationCode.trim()) {
+        //     newErrors.invitationCode = '请输入邀请码';
+        // }
 
         setErrors(newErrors);
         return Object.keys(newErrors).length === 0;
@@ -197,23 +197,24 @@ export default function Login({ setIsLoggedIn }: { setIsLoggedIn: (loggedIn: boo
                 <Form.Item
                     label="邀请码"
                     name="invitationCode"
-                    required
-                    help={errors.invitationCode}
-                    validateState={errors.invitationCode ? 'error' : undefined}>
+                    // required
+                    // help={errors.invitationCode}
+                    // validateState={errors.invitationCode ? 'error' : undefined}
+                    >
                     <Input
                         htmlType="invitationCode"
                         placeholder="请输入邀请码"
-                        value={invitationCode}
-                        onChange={(value) => {
-                            if (typeof value === 'string') {
-                                setInvitationCode(value);
-                            } else {
-                                setInvitationCode(String(value));
-                            }
-                            if (errors.invitationCode) {
-                                setErrors({ ...errors, invitationCode: undefined });
-                            }
-                        }}
+                        // value={invitationCode}
+                        // onChange={(value) => {
+                        //     if (typeof value === 'string') {
+                        //         setInvitationCode(value);
+                        //     } else {
+                        //         setInvitationCode(String(value));
+                        //     }
+                        //     if (errors.invitationCode) {
+                        //         setErrors({ ...errors, invitationCode: undefined });
+                        //     }
+                        // }}
                         disabled={loading}
                     />
                 </Form.Item>