import React, { useState } from "react"; import { Form, Input, Button, Tabs, message } from "antd"; import Icon from "@ant-design/icons"; import styles from "./login.module.css"; // import { sendCode, loginBySendCode, login } from "../../http/sso"; import { login } from "../../http/sso"; import LogoIcon from "@src/assets/images/login/logo.svg?react"; import GonganIcon from "@src/assets/images/login/gongan.png"; const LoginPage: React.FC = () => { // const [form] = Form.useForm(); // const [loading, setLoading] = useState(false); // const [sendingCode, setSendingCode] = useState(false); // const [countdown, setCountdown] = useState(0); const [accountForm] = Form.useForm(); const [accountLoading, setAccountLoading] = useState(false); // const handlePhoneLogin = async (values: any) => { // try { // setLoading(true); // const { phone, code } = values; // const success = await loginBySendCode(phone, code); // if (success) { // // Redirect will be handled by the login function // } // } catch (error) { // message.error((error as Error)?.message || "登录失败,请重试"); // } finally { // setLoading(false); // } // }; // const handleSendCode = async () => { // try { // const phone = form.getFieldValue("phone"); // if (!phone) { // message.error("请输入手机号"); // return; // } // if (!/^1[3-9]\d{9}$/.test(phone)) { // message.error("请输入正确的手机号"); // return; // } // setSendingCode(true); // const success = await sendCode(phone); // if (success) { // let count = 60; // setCountdown(count); // const timer = setInterval(() => { // count -= 1; // setCountdown(count); // if (count <= 0) { // clearInterval(timer); // setCountdown(0); // } // }, 1000); // } // } catch (error) { // message.error( // (error as Error)?.message || "发送验证码失败,请重试" // ); // } finally { // setSendingCode(false); // } // }; const handleAccountLogin = async (values: any) => { try { setAccountLoading(true); const { account, password } = values; const success = await login(account, password); if (success) { // Redirect will be handled by the login function } } catch (error) { message.error((error as Error)?.message || "登录失败,请重试"); } finally { setAccountLoading(false); } }; return (
© 2020 湖南为趣时代网络科技有限公司
window.open('https://rescdn.yishihui.com/agreement/piaoquantvservice.html')}> 用户服务协议 | window.open('https://rescdn.yishihui.com/agreement/piaoquantvagreement.html')}> 隐私政策 | window.open('https://www.piaoquantv.com/upload/help')}> 帮助中心 | 客服及举报: 0731-85679198、18974809627 | 举报邮箱:piaoquankefu@new.piaoquantv.com
window.open('https://beian.miit.gov.cn/')}>
湘ICP备16013107-06号
|
window.open('https://beian.mps.gov.cn/#/query/webSearch')}>
湘公网安备:43019002001624