diff --git a/src/passport/qr-confirm/index.tsx b/src/passport/qr-confirm/index.tsx index bbfa8bc..3564add 100644 --- a/src/passport/qr-confirm/index.tsx +++ b/src/passport/qr-confirm/index.tsx @@ -1,7 +1,6 @@ import React, { useState, useEffect } from 'react'; import { View, Text } from '@tarojs/components'; -import { Loading, Card, Button } from '@nutui/nutui-react-taro'; -import { Success, Failure, Tips, User } from '@nutui/icons-react-taro'; +import { Button } from '@nutui/nutui-react-taro'; import Taro, { useRouter } from '@tarojs/taro'; import { confirmQRLogin } from '@/api/passport/qr-login'; import { loginByOpenId } from '@/api/passport/wx-login'; @@ -321,13 +320,6 @@ const QRConfirmPage: React.FC = () => { } }; - /** - * 手动确认登录(主动扫码场景) - */ - const handleManualConfirm = () => { - handleConfirmLogin(); - }; - /** * 取消登录 */ @@ -545,7 +537,7 @@ const QRConfirmPage: React.FC = () => { WebkitTextFillColor: 'transparent', backgroundClip: 'text', marginBottom: '8px', - }}>WebSopy + }}>websopy {/* 标语 */} { {/* 登录卡片 */} - - {/* 提示图标 */} - - - 📱 - - + {/**/} + {/* /!* 提示图标 *!/*/} + {/* */} + {/* */} + {/* 📱*/} + {/* */} + {/* */} - {/* 标题 */} - 授权登录 + {/* /!* 标题 *!/*/} + {/* 授权登录*/} - {/* 描述 */} - 点击下方按钮,使用微信手机号快速登录 - + {/* /!* 描述 *!/*/} + {/* 点击下方按钮,使用微信手机号快速登录*/} + {/**/} {/* 主按钮 - 渐变发光按钮 */} { ); }; - // 渲染状态图标 - const renderStatusIcon = () => { - if (loading || authLoading) return ( - - - - - - ); - - if (confirmed) return ( - - - - - - ); - - if (error && !needAuth) return ( - - - - - - ); - - if (needAuth) { - // 需要授权时显示授权页面 - return renderAuthPage(); - } - - return ( - - - - - - ); - }; - - // 获取标题 - const getTitle = () => { - if (loading || authLoading) return '正在处理...'; - if (confirmed) return '登录确认成功'; - if (needAuth) return ''; // 授权页面有自己的标题 - if (error) return '登录确认失败'; - return loginMethod === 'url' ? '扫码登录确认' : '确认登录'; - }; - - // 获取描述 - const getDescription = () => { - if (loading) return '请稍候,正在为您确认登录'; - if (authLoading) return '正在授权登录...'; - if (confirmed) return '您已成功确认登录,网页端将自动登录'; - if (needAuth) return ''; // 授权页面有自己的描述 - if (error) return error; - if (loginMethod === 'url') { - return '检测到登录请求,是否确认登录?'; - } - const displayName = userInfo?.nickname || userInfo?.username || '当前用户'; - return `确认使用 ${displayName} 登录网页端?`; - }; - - // 渲染操作按钮 - const renderActions = () => { - // 需要授权登录时,按钮在授权页面内部渲染 - if (needAuth) { - return null; - } - - if (loading) { - return ( - - 确认中... - - ); - } - - if (confirmed) { - return ( - - 完成 - - ); - } - - if (error) { - return ( - - - 重试 - - - 扫码其他二维码 - - - 取消 - - - ); - } - - if (loginMethod === 'scan') { - return ( - - - 确认登录 - - - 取消 - - - ); - } - - return ( - - 确认登录 - - ); - }; // 如果是授权页面,直接返回授权页面 - if (needAuth) { - return renderAuthPage(); - } + return renderAuthPage(); - return ( - - - {/* Logo/品牌区域 */} - - - 🔐 - - WebSoft Platform - - - {/* 主要内容卡片 */} - - - {/* 状态图标 */} - {renderStatusIcon()} - - {/* 标题 */} - {getTitle() && ( - - {getTitle()} - - )} - - {/* 描述 */} - {getDescription() && ( - - {getDescription()} - - )} - - {/* 用户信息 */} - {!loading && !confirmed && !error && !needAuth && userInfo && ( - - - {userInfo.avatar ? ( - - ) : ( - - - - )} - - - {userInfo.nickname || userInfo.username || '用户'} - - - ID: {userInfo.userId} - - - - - )} - - {/* Token 信息 */} - {token && !loading && !confirmed && !needAuth && ( - - - 登录令牌:{token.substring(0, 20)}...{token.substring(token.length - 10)} - - - )} - - {/* 操作按钮 */} - {renderActions()} - - - - {/* 安全提示 */} - {!needAuth && ( - - - - - - - 安全提示 - - - 请确认这是您本人的登录操作。如果不是,请点击取消并检查账户安全。 - - - - - - )} - - {/* 底部说明 */} - - - 如有问题,请联系管理员 - - - - - ); }; export default QRConfirmPage;