diff --git a/src/api/index.ts b/src/api/index.ts index b224c91..1d6729e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,3 +1,4 @@ import * as login from "./login"; +import * as system from "./system"; -export {login} +export { login, system }; diff --git a/src/api/login.ts b/src/api/login.ts index ba3c0d3..fdf002e 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -10,7 +10,7 @@ export function login( email: email, password: password, captcha_key: captchaKey, - captcha_val: captchaVal, + captcha_value: captchaVal, }); } diff --git a/src/api/system.ts b/src/api/system.ts new file mode 100644 index 0000000..d038bb1 --- /dev/null +++ b/src/api/system.ts @@ -0,0 +1,10 @@ +import client from "./internal/httpClient"; + +export function getImageCaptcha() { + return client.get("/backend/v1/system/image-captcha", {}); +} + +export function getUser() { + return client.get("/backend/v1/auth/detail", {}); + } + diff --git a/src/pages/home/HomePage.module.css b/src/pages/home/HomePage.module.css index 42bbe50..dd6ded8 100644 --- a/src/pages/home/HomePage.module.css +++ b/src/pages/home/HomePage.module.css @@ -26,3 +26,5 @@ overflow-y: auto; background-color: #f1f2f9; } + + diff --git a/src/pages/login/Login.module.css b/src/pages/login/Login.module.css index e69de29..3882405 100644 --- a/src/pages/login/Login.module.css +++ b/src/pages/login/Login.module.css @@ -0,0 +1,22 @@ +.login-content { + width: 100%; + float: left; + height: 100%; + background-color: #fff; +} + +.login-box { + width: 1200px; + height: 500px; + margin-left: auto; + margin-right: auto; + margin-top: 150px; +} + +.captcha { + width: 120px; + height: 48px; + margin-left: 10px; + cursor: pointer; + cursor: pointer; +} diff --git a/src/pages/login/Login.tsx b/src/pages/login/Login.tsx index 0269fff..f585b4f 100644 --- a/src/pages/login/Login.tsx +++ b/src/pages/login/Login.tsx @@ -1,6 +1,134 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import styles from "./Login.module.css"; +import { Typography, Spin, Input, Button, message } from "antd"; +import { login, system } from "../../api/index"; +import { setToken } from "../../utils/index"; -export const Login: React.FC = () => { - return