|
|
@@ -1,25 +1,25 @@
|
|
|
-import { useNavigate } from "@umijs/max";
|
|
|
+import { useNavigate } from '@umijs/max';
|
|
|
import React from "react";
|
|
|
-import * as LoginController from '@/services/login/LoginController';
|
|
|
-import { Button } from 'antd';
|
|
|
+import {Button, Flex} from "antd";
|
|
|
|
|
|
|
|
|
const LoginPage: React.FC = () => {
|
|
|
const navigate = useNavigate();
|
|
|
-
|
|
|
- const handleLogin = async () => {
|
|
|
- if (localStorage.getItem('token')) {
|
|
|
- navigate('/');
|
|
|
- } else {
|
|
|
- const data = await LoginController.login({ username: 'mxkj_xy', password: 'Aa@@1144' });
|
|
|
- if (data.code === 200) {
|
|
|
- localStorage.setItem('token', data.data.accessToken as string)
|
|
|
- navigate('/');
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- return <Button onClick={handleLogin}>登录</Button>;
|
|
|
+ return (
|
|
|
+ <Flex style={{ height: '100vh' }} justify="center" align="center" gap="middle" vertical>
|
|
|
+ <h1>统一登录(甲方提供)</h1>
|
|
|
+ <Button
|
|
|
+ style={{ width: "200px" }}
|
|
|
+ color="primary"
|
|
|
+ variant="solid"
|
|
|
+ onClick={() => {
|
|
|
+ navigate('/login/callback?sessionId=xxxxxxxx')
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 登录
|
|
|
+ </Button>
|
|
|
+ </Flex>
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
export default LoginPage;
|