|
|
@ -1,22 +1,38 @@ |
|
|
|
import { Layout, Tabs, Input, Button, Typography, Row, Col, Form } from "antd"; |
|
|
|
import { QrcodeOutlined, UserOutlined, LockOutlined } from "@ant-design/icons"; |
|
|
|
import SelectLang from "@/components/select-lang"; |
|
|
|
import { UserOutlined, LockOutlined } from "@ant-design/icons"; |
|
|
|
import { createFileRoute, useNavigate } from "@tanstack/react-router"; |
|
|
|
import { useAtom, useAtomValue } from "jotai"; |
|
|
|
import { useTranslation } from "@/i18n.ts"; |
|
|
|
import { |
|
|
|
emailCodeAtom, |
|
|
|
emailLoginAtom, |
|
|
|
telegramCodeAtom, |
|
|
|
telegramLoginAtom, |
|
|
|
upLoginAtom, |
|
|
|
} from "@/store/system/user.ts"; |
|
|
|
import { useAtomValue } from "jotai"; |
|
|
|
import { emailLoginAtom, telegramLoginAtom, upLoginAtom } from "@/store/system/user.ts"; |
|
|
|
import React, { memo, useEffect, useLayoutEffect, useState } from "react"; |
|
|
|
import systemServ from "@/service/system.ts"; |
|
|
|
import { t } from "i18next"; |
|
|
|
const { Title, Text, Link } = Typography; |
|
|
|
const { TabPane } = Tabs; |
|
|
|
|
|
|
|
const i18nPrefix = "login"; |
|
|
|
|
|
|
|
const Login = memo(() => { |
|
|
|
const languageSet = { |
|
|
|
邮箱密码登录: t(`${i18nPrefix}.emailPasswordLogin`, "邮箱密码登录"), |
|
|
|
向量检索服务免费试用: t(`${i18nPrefix}.vectorRetrievalServiceFreeTrial`, "向量检索服务免费试用"), |
|
|
|
免费试用向量检索服务玩转大模型生成式检索: t( |
|
|
|
`${i18nPrefix}.freeTrialVectorRetrievalService`, |
|
|
|
"免费试用向量检索服务,玩转大模型生成式检索", |
|
|
|
), |
|
|
|
查看详情: t(`${i18nPrefix}.viewDetails`, "查看详情 >"), |
|
|
|
请输入邮箱: t(`${i18nPrefix}.pleaseEnterEmail`, "请输入邮箱"), |
|
|
|
请输入登录密码: t(`${i18nPrefix}.pleaseEnterPassword`, "请输入登录密码"), |
|
|
|
登录: t(`${i18nPrefix}.login`, "登录"), |
|
|
|
邮箱验证登录: t(`${i18nPrefix}.emailVerificationLogin`, "邮箱验证登录"), |
|
|
|
获得验证码: t(`${i18nPrefix}.getVerificationCode`, "获得验证码"), |
|
|
|
请输入验证码: t(`${i18nPrefix}.pleaseEnterVerificationCode`, "请输入验证码"), |
|
|
|
飞机验证登录: t(`${i18nPrefix}.telegramVerificationLogin`, "飞机验证登录"), |
|
|
|
获得飞机验证码: t(`${i18nPrefix}.getTelegramVerificationCode`, "获得飞机验证码"), |
|
|
|
请输入飞机验证码: t(`${i18nPrefix}.pleaseEnterTelegramVerificationCode`, "请输入飞机验证码"), |
|
|
|
注册: t(`${i18nPrefix}.register`, "注册"), |
|
|
|
忘记密码: t(`${i18nPrefix}.forgotPassword`, "忘记密码"), |
|
|
|
}; |
|
|
|
|
|
|
|
const navigate = useNavigate(); |
|
|
|
const [upform] = Form.useForm(); |
|
|
|
const [emailform] = Form.useForm(); |
|
|
@ -100,10 +116,10 @@ const Login = memo(() => { |
|
|
|
<Col> |
|
|
|
<Row> |
|
|
|
<Col span={12} style={{ padding: "20px" }}> |
|
|
|
<Title level={3}>向量检索服务免费试用</Title> |
|
|
|
<Text>免费试用向量检索服务,玩转大模型生成式检索</Text> |
|
|
|
<Title level={3}>{languageSet.向量检索服务免费试用}</Title> |
|
|
|
<Text>{languageSet.免费试用向量检索服务玩转大模型生成式检索}</Text> |
|
|
|
<br /> |
|
|
|
<Link href="#">查看详情 ></Link> |
|
|
|
<Link href="#">{languageSet.查看详情}</Link> |
|
|
|
</Col> |
|
|
|
<Col |
|
|
|
span={12} |
|
|
@ -117,78 +133,75 @@ const Login = memo(() => { |
|
|
|
}} |
|
|
|
> |
|
|
|
<Tabs defaultActiveKey="1" style={{ marginTop: "50px" }}> |
|
|
|
<TabPane tab="邮箱密码登录" key="1"> |
|
|
|
<TabPane tab={languageSet.邮箱密码登录} key="1"> |
|
|
|
<Form form={upform} onFinish={uphandleSubmit}> |
|
|
|
<Form.Item name="username" rules={[{ required: true, message: "请输入邮箱" }]}> |
|
|
|
<Input size="large" placeholder="请输入邮箱" prefix={<UserOutlined />} /> |
|
|
|
<Form.Item name="username" rules={[{ required: true, message: languageSet.请输入邮箱 }]}> |
|
|
|
<Input size="large" placeholder={languageSet.请输入邮箱} prefix={<UserOutlined />} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name="password" rules={[{ required: true, message: "请输入登录密码" }]}> |
|
|
|
<Form.Item name="password" rules={[{ required: true, message: languageSet.请输入登录密码 }]}> |
|
|
|
<Input.Password |
|
|
|
size="large" |
|
|
|
placeholder="请输入登录密码" |
|
|
|
placeholder={languageSet.请输入登录密码} |
|
|
|
prefix={<LockOutlined />} |
|
|
|
autoComplete="off" |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
{/*<Form.Item name="code" rules={[{ required: true, message: "请输入验证码" }]}>*/} |
|
|
|
{/* <Input.Password size="large" placeholder="验证码" prefix={<LockOutlined />} />*/} |
|
|
|
{/*</Form.Item>*/} |
|
|
|
<Button type="primary" htmlType="submit" style={{ width: "100%" }}> |
|
|
|
登录 |
|
|
|
{languageSet.登录} |
|
|
|
</Button> |
|
|
|
</Form> |
|
|
|
</TabPane> |
|
|
|
<TabPane tab="邮箱验证登录" key="2"> |
|
|
|
<TabPane tab={languageSet.邮箱验证登录} key="2"> |
|
|
|
<Form form={emailform} onFinish={emailhandleSubmit}> |
|
|
|
<Form.Item name="email" rules={[{ required: true, message: "请输入邮箱" }]}> |
|
|
|
<Form.Item name="email" rules={[{ required: true, message: languageSet.请输入邮箱 }]}> |
|
|
|
<Input |
|
|
|
size="large" |
|
|
|
placeholder="请输入邮箱" |
|
|
|
placeholder={languageSet.请输入邮箱} |
|
|
|
prefix={<UserOutlined />} |
|
|
|
addonAfter={ |
|
|
|
<Button onClick={getEmailCode} disabled={isButtonDisabled}> |
|
|
|
{isButtonDisabled ? `${countdown}秒后重试` : "获得验证码"} |
|
|
|
{isButtonDisabled ? `${countdown}秒后重试` : languageSet.获得验证码} |
|
|
|
</Button> |
|
|
|
} |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name="code" rules={[{ required: true, message: "请输入验证码" }]}> |
|
|
|
<Form.Item name="code" rules={[{ required: true, message: languageSet.请输入验证码 }]}> |
|
|
|
<Input.Password |
|
|
|
size="large" |
|
|
|
placeholder="请输入验证码" |
|
|
|
placeholder={languageSet.请输入验证码} |
|
|
|
prefix={<LockOutlined />} |
|
|
|
autoComplete="off" |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
<Button type="primary" htmlType="submit" style={{ width: "100%" }}> |
|
|
|
登录 |
|
|
|
{languageSet.登录} |
|
|
|
</Button> |
|
|
|
</Form> |
|
|
|
</TabPane> |
|
|
|
<TabPane tab="飞机验证登录" key="3"> |
|
|
|
<TabPane tab={languageSet.飞机验证登录} key="3"> |
|
|
|
<Form form={telegramform} onFinish={telegramhandleSubmit}> |
|
|
|
<Form.Item name="telegram" rules={[{ required: true, message: "请输入邮箱" }]}> |
|
|
|
<Form.Item name="telegram" rules={[{ required: true, message: languageSet.请输入邮箱 }]}> |
|
|
|
<Input |
|
|
|
size="large" |
|
|
|
placeholder="请输入邮箱" |
|
|
|
placeholder={languageSet.请输入邮箱} |
|
|
|
prefix={<UserOutlined />} |
|
|
|
addonAfter={ |
|
|
|
<Button onClick={getTelegramCode} disabled={isButtonDisabled}> |
|
|
|
{isButtonDisabled ? `${countdown}秒后重试` : "获得飞机验证码"} |
|
|
|
{isButtonDisabled ? `${countdown}秒后重试` : languageSet.获得飞机验证码} |
|
|
|
</Button> |
|
|
|
} |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name="code" rules={[{ required: true, message: "请输入飞机验证码" }]}> |
|
|
|
<Form.Item name="code" rules={[{ required: true, message: languageSet.请输入飞机验证码 }]}> |
|
|
|
<Input.Password |
|
|
|
size="large" |
|
|
|
placeholder="请输入飞机验证码" |
|
|
|
placeholder={languageSet.请输入飞机验证码} |
|
|
|
prefix={<LockOutlined />} |
|
|
|
autoComplete="off" |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
<Button type="primary" htmlType="submit" style={{ width: "100%" }}> |
|
|
|
登录 |
|
|
|
{languageSet.登录} |
|
|
|
</Button> |
|
|
|
</Form> |
|
|
|
</TabPane> |
|
|
@ -220,11 +233,11 @@ const Login = memo(() => { |
|
|
|
}} |
|
|
|
onClick={() => navigate({ to: "/register" })} |
|
|
|
> |
|
|
|
注册 |
|
|
|
{languageSet.注册} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<Row justify="space-between" style={{ marginTop: "10px" }}> |
|
|
|
<Link onClick={() => navigate({ to: "/pwdRetrieve" })}>忘记密码</Link> |
|
|
|
<Link onClick={() => navigate({ to: "/pwdRetrieve" })}>{languageSet.忘记密码}</Link> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|