mirror of
https://github.com/PlayEdu/backend
synced 2025-06-09 14:44:11 +08:00
登录页面初步
This commit is contained in:
parent
04c3fb3851
commit
0dad3f206e
@ -10,6 +10,9 @@ export class HttpClient {
|
|||||||
baseURL: url,
|
baseURL: url,
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
withCredentials: false,
|
withCredentials: false,
|
||||||
|
headers:{
|
||||||
|
"Accept":"application/json"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//拦截器注册
|
//拦截器注册
|
||||||
|
@ -17,3 +17,7 @@ export function login(
|
|||||||
export function logout() {
|
export function logout() {
|
||||||
return client.post("/backend/v1/auth/logout", {});
|
return client.post("/backend/v1/auth/logout", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getUser() {
|
||||||
|
return client.get("/backend/v1/auth/detail", {});
|
||||||
|
}
|
@ -4,7 +4,3 @@ export function getImageCaptcha() {
|
|||||||
return client.get("/backend/v1/system/image-captcha", {});
|
return client.get("/backend/v1/system/image-captcha", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUser() {
|
|
||||||
return client.get("/backend/v1/auth/detail", {});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export const Login: React.FC = (defaultState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getUser = () => {
|
const getUser = () => {
|
||||||
system.getUser().then((res) => {
|
login.getUser().then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -65,20 +65,7 @@ export const Login: React.FC = (defaultState) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
if (loading) {
|
|
||||||
return (
|
|
||||||
<Spin
|
|
||||||
size="large"
|
|
||||||
style={{
|
|
||||||
marginTop: 200,
|
|
||||||
marginBottom: 200,
|
|
||||||
marginLeft: "auto",
|
|
||||||
marginRight: "auto",
|
|
||||||
width: "100%",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div className={styles["login-content"]}>
|
<div className={styles["login-content"]}>
|
||||||
<div className={styles["login-box"]}>
|
<div className={styles["login-box"]}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user