Browse Source

登录 修改 注册 人机接口加上 多语言加上

main
lk 2 months ago
parent
commit
fec0a87cee
  1. 7
      src/pages/use/login/index.tsx
  2. 41
      src/pages/use/register/index.tsx

7
src/pages/use/login/index.tsx

@ -1,13 +1,9 @@
import { Layout, Tabs, Input, Button, Typography, Row, Col, Form } from "antd"; import { Layout, Tabs, Input, Button, Typography, Row, Col, Form } from "antd";
import { QrcodeOutlined, UserOutlined, LockOutlined } from "@ant-design/icons"; import { QrcodeOutlined, UserOutlined, LockOutlined } from "@ant-design/icons";
import SelectLang from "@/components/select-lang";
import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { useAtom, useAtomValue } from "jotai"; import { useAtom, useAtomValue } from "jotai";
import { useTranslation } from "@/i18n.ts";
import { import {
emailCodeAtom,
emailLoginAtom, emailLoginAtom,
telegramCodeAtom,
telegramLoginAtom, telegramLoginAtom,
upLoginAtom, upLoginAtom,
} from "@/store/system/user.ts"; } from "@/store/system/user.ts";
@ -15,6 +11,8 @@ import React, { memo, useEffect, useLayoutEffect, useRef, useState } from "react
import systemServ from "@/service/system.ts"; import systemServ from "@/service/system.ts";
import SlideCapt, { SlideCaptRef } from "@/components/captcha/SlideCapt.tsx"; import SlideCapt, { SlideCaptRef } from "@/components/captcha/SlideCapt.tsx";
import { t } from "i18next"; import { t } from "i18next";
import Verification from "@/components/captcha/Verification.tsx";
const { Title, Text, Link } = Typography; const { Title, Text, Link } = Typography;
const { TabPane } = Tabs; const { TabPane } = Tabs;
@ -259,6 +257,7 @@ const Login = memo(() => {
checkCaptcha: systemServ.captchaCheck, checkCaptcha: systemServ.captchaCheck,
}} }}
/> />
<Verification content={"调试用"}/>
</Form.Item> </Form.Item>
<Button type="primary" htmlType="submit" style={{ width: "100%" }}> <Button type="primary" htmlType="submit" style={{ width: "100%" }}>
{languageSet.} {languageSet.}

41
src/pages/use/register/index.tsx

@ -9,29 +9,32 @@ import systemServ from "@/service/system.ts";
import { t } from "i18next"; import { t } from "i18next";
import SlideCapt, { SlideCaptRef } from "@/components/captcha/SlideCapt.tsx"; import SlideCapt, { SlideCaptRef } from "@/components/captcha/SlideCapt.tsx";
const languageSet = {
向量检索服务免费试用: t("register.vectorRetrievalServiceFreeTrial", "向量检索服务免费试用"),
免费试用向量检索服务玩转大模型生成式检索: t(
"register.freeTrialVectorRetrievalService",
"免费试用向量检索服务,玩转大模型生成式检索",
),
查看详情: t("register.viewDetails", "查看详情 &gt;"),
请输入邮箱: t("register.pleaseEnterEmail", "请输入邮箱"),
获得验证码: t("register.getVerificationCode", "获得验证码"),
秒后重试: t("register.retryAfterSeconds", "秒后重试"),
请输入验证码: t("register.pleaseEnterVerificationCode", "请输入验证码"),
请输入密码: t("register.pleaseEnterPassword", "请输入密码"),
请确认密码: t("register.confirmPassword", "请确认密码"),
两次输入的密码不一致: t("register.passwordsDoNotMatch", "两次输入的密码不一致"),
点击进行校验: t("login.clickToVerify", "点击进行校验"),
注册: t("register.register", "注册"),
登录: t("register.login", "登录"),
返回登录: t("register.backToLogin", "返回登录"),
};
const { Title, Text, Link } = Typography; const { Title, Text, Link } = Typography;
const Register = memo(() => { const Register = memo(() => {
const languageSet = {
向量检索服务免费试用: t("register.vectorRetrievalServiceFreeTrial", "向量检索服务免费试用"),
免费试用向量检索服务玩转大模型生成式检索: t(
"register.freeTrialVectorRetrievalService",
"免费试用向量检索服务,玩转大模型生成式检索",
),
查看详情: t("register.viewDetails", "查看详情 &gt;"),
请输入邮箱: t("register.pleaseEnterEmail", "请输入邮箱"),
获得验证码: t("register.getVerificationCode", "获得验证码"),
秒后重试: t("register.retryAfterSeconds", "秒后重试"),
请输入验证码: t("register.pleaseEnterVerificationCode", "请输入验证码"),
请输入密码: t("register.pleaseEnterPassword", "请输入密码"),
请确认密码: t("register.confirmPassword", "请确认密码"),
两次输入的密码不一致: t("register.passwordsDoNotMatch", "两次输入的密码不一致"),
点击进行校验: t("login.clickToVerify", "点击进行校验"),
注册: t("register.register", "注册"),
登录: t("register.login", "登录"),
返回登录: t("register.backToLogin", "返回登录"),
};
const navigate = useNavigate(); const navigate = useNavigate();
const [registerForm] = Form.useForm(); const [registerForm] = Form.useForm();
const { mutate: emailRegisterMutate } = useAtomValue(emailRegisterAtom); const { mutate: emailRegisterMutate } = useAtomValue(emailRegisterAtom);

Loading…
Cancel
Save