merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构
来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2
冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
@@ -23,6 +23,7 @@ import React, {
|
||||
useRef,
|
||||
useState,
|
||||
useCallback,
|
||||
useMemo,
|
||||
lazy,
|
||||
Suspense,
|
||||
} from 'react';
|
||||
@@ -70,6 +71,10 @@ import GlassCard from './GlassCard';
|
||||
import AuthCardHeader from './AuthCardHeader';
|
||||
import AuthLoginTabs from './AuthLoginTabs';
|
||||
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
|
||||
import {
|
||||
isMiniProgramWebView,
|
||||
withMiniProgramLogins,
|
||||
} from '../../helpers/miniProgram';
|
||||
|
||||
// 懒加载 Telegram 登录组件(345KB),只在需要时加载
|
||||
const TelegramLogin = lazy(() => import('./TelegramLogin'));
|
||||
@@ -177,7 +182,11 @@ const LoginForm = () => {
|
||||
|
||||
// 使用 StatusContext 获取最新状态,而不是从 localStorage 读取
|
||||
const [statusState] = useContext(StatusContext);
|
||||
const status = statusState?.status || {};
|
||||
// WeyAi 小程序的 web-view 里只留站内能完成的登录方式(见 helpers/miniProgram.js)。
|
||||
const status = useMemo(() => {
|
||||
const raw = statusState?.status || {};
|
||||
return isMiniProgramWebView() ? withMiniProgramLogins(raw) : raw;
|
||||
}, [statusState?.status]);
|
||||
const statusLoaded = statusState?.status !== undefined;
|
||||
|
||||
// affCode 只需在挂载时提取一次,避免每次渲染都执行
|
||||
|
||||
@@ -23,6 +23,7 @@ import React, {
|
||||
useRef,
|
||||
useState,
|
||||
useCallback,
|
||||
useMemo,
|
||||
lazy,
|
||||
Suspense,
|
||||
} from 'react';
|
||||
@@ -65,6 +66,10 @@ import AuthCardHeader from './AuthCardHeader';
|
||||
import AuthLoginTabs from './AuthLoginTabs';
|
||||
import { ArrowRight, Shield, Smartphone, QrCode } from 'lucide-react';
|
||||
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
|
||||
import {
|
||||
isMiniProgramWebView,
|
||||
withMiniProgramLogins,
|
||||
} from '../../helpers/miniProgram';
|
||||
|
||||
// 懒加载 Telegram 登录组件(345KB),只在需要时加载
|
||||
const TelegramLogin = lazy(() => import('./TelegramLogin'));
|
||||
@@ -148,7 +153,11 @@ const RegisterForm = () => {
|
||||
|
||||
// 使用 StatusContext 获取最新状态,而不是从 localStorage 读取
|
||||
const [statusState] = useContext(StatusContext);
|
||||
const status = statusState?.status || {};
|
||||
// WeyAi 小程序的 web-view 里只留站内能完成的注册方式(见 helpers/miniProgram.js)。
|
||||
const status = useMemo(() => {
|
||||
const raw = statusState?.status || {};
|
||||
return isMiniProgramWebView() ? withMiniProgramLogins(raw) : raw;
|
||||
}, [statusState?.status]);
|
||||
const statusLoaded = statusState?.status !== undefined;
|
||||
|
||||
const [showEmailVerification, setShowEmailVerification] = useState(() => {
|
||||
@@ -235,7 +244,7 @@ const RegisterForm = () => {
|
||||
|
||||
const onSubmitWeChatVerificationCode = async () => {
|
||||
if (turnstileEnabled && turnstileToken === '') {
|
||||
showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!');
|
||||
showInfo(t('请稍后几秒重试,Turnstile 正在检查用户环境!'));
|
||||
return;
|
||||
}
|
||||
setWechatCodeSubmitLoading(true);
|
||||
@@ -253,7 +262,7 @@ const RegisterForm = () => {
|
||||
showError(message);
|
||||
}
|
||||
} catch (error) {
|
||||
showError('登录失败,请重试');
|
||||
showError(t('登录失败,请重试'));
|
||||
} finally {
|
||||
setWechatCodeSubmitLoading(false);
|
||||
}
|
||||
@@ -281,7 +290,7 @@ const RegisterForm = () => {
|
||||
}
|
||||
if (username && password) {
|
||||
if (turnstileEnabled && turnstileToken === '') {
|
||||
showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!');
|
||||
showInfo(t('请稍后几秒重试,Turnstile 正在检查用户环境!'));
|
||||
return;
|
||||
}
|
||||
setRegisterLoading(true);
|
||||
@@ -316,7 +325,7 @@ const RegisterForm = () => {
|
||||
const sendVerificationCode = async () => {
|
||||
if (inputs.email === '') return;
|
||||
if (turnstileEnabled && turnstileToken === '') {
|
||||
showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!');
|
||||
showInfo(t('请稍后几秒重试,Turnstile 正在检查用户环境!'));
|
||||
return;
|
||||
}
|
||||
setVerificationCodeLoading(true);
|
||||
@@ -445,7 +454,7 @@ const RegisterForm = () => {
|
||||
showError(message);
|
||||
}
|
||||
} catch (error) {
|
||||
showError('登录失败,请重试');
|
||||
showError(t('登录失败,请重试'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -529,7 +538,7 @@ const RegisterForm = () => {
|
||||
loading={githubLoading}
|
||||
disabled={githubButtonDisabled}
|
||||
>
|
||||
{githubButtonText}
|
||||
{t(githubButtonText)}
|
||||
</OAuthButton>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user