注册登录
Change-Id: Ic0253e2ef228333a5982e887c8bac7389f914f5f
diff --git a/src/views/login/login.tsx b/src/views/login/login.tsx
index 1bc18c2..e135e97 100644
--- a/src/views/login/login.tsx
+++ b/src/views/login/login.tsx
@@ -9,6 +9,8 @@
import { getUserInfo } from '@/api/user';
import debounce from 'lodash/debounce';
import { message } from 'antd';
+import { postUserRegister } from '@/api/auth'
+import { sendVerificationCode } from '@/api/auth'
const Login: React.FC = () => {
const [email, setEmail] = useState('');
@@ -84,7 +86,14 @@
}
}, 1000);
setCodeTimer(timer);
+
// TODO: 调用发送验证码接口
+ const bodyData = {
+ email:registerEmail,
+ }
+
+ const res = await request.post(sendVerificationCode, bodyData);
+ console.log("res", res);
message.success('验证码已发送');
};
@@ -107,6 +116,18 @@
return;
}
// TODO: 调用注册接口
+
+ const sendData = {
+ userName,
+ password:registerPassword,
+ email:registerEmail,
+ verificationCode: emailCode,
+ invitationCode:inviteCode,
+ }
+
+ const res = await request.post(postUserRegister, sendData);
+ console.log("res", res);
+
message.success('注册成功,请登录');
handleBackToLogin();
};