Skip to content

Commit

Permalink
style: 优化登录页面代码
Browse files Browse the repository at this point in the history
  • Loading branch information
KouShenhai committed Jul 7, 2024
1 parent f2dc274 commit c2f7514
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ui/src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default () => {
password: encodeURIComponent(
encrypt.encrypt(form.password as string),
),
tenant_id: '0',
tenant_id: form.tenant_id,
grant_type: 'password',
};
}
Expand All @@ -85,6 +85,11 @@ export default () => {
};

const getCaptchaImage = async () => {
// 清空验证码输入框
formRef?.current?.setFieldsValue({
captcha: '',
});
// 调用验证码API
const uuid = uuidV7();
getCaptchaImageByUuidV3({uuid: uuid}).then((res) => {
setCaptchaImage(res.data);
Expand Down Expand Up @@ -364,7 +369,7 @@ export default () => {
}
return '获取验证码';
}}
name="captcha"
name="mobile_captcha"
rules={[
{
required: true,
Expand Down Expand Up @@ -414,7 +419,7 @@ export default () => {
}
return '获取验证码';
}}
name="captcha"
name="mail_captcha"
rules={[
{
required: true,
Expand Down
2 changes: 2 additions & 0 deletions ui/src/services/auth/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ declare namespace API {
captcha?: string;
mail?: string;
mobile?: string;
mail_captcha?: string;
mobile_captcha?: string;
tenant_id?: string
};

Expand Down

0 comments on commit c2f7514

Please sign in to comment.