feat: 修复登陆和注册button请求事件
This commit is contained in:
@@ -239,6 +239,8 @@ export default function AuthFormContent() {
|
||||
credential: phone,
|
||||
verification_code: verificationCode,
|
||||
login_type: 'phone',
|
||||
type: 'phone',
|
||||
purpose: config.api.purpose, // 使用配置中的purpose
|
||||
};
|
||||
|
||||
// 调用API(根据模式选择不同的endpoint)
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { FaQrcode } from "react-icons/fa";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { QRCodeSVG } from "qrcode.react";
|
||||
import { authService, WECHAT_STATUS, STATUS_MESSAGES } from "../../services/authService";
|
||||
|
||||
// 配置常量
|
||||
@@ -194,6 +195,8 @@ export default function WechatRegister() {
|
||||
|
||||
const response = await authService.getWechatQRCode();
|
||||
|
||||
console.log(`zdl getWechatQRCode ${JSON.stringify(response)}`)
|
||||
|
||||
// 检查组件是否已卸载
|
||||
if (!isMountedRef.current) return;
|
||||
|
||||
@@ -267,7 +270,11 @@ export default function WechatRegister() {
|
||||
{/* 灰色二维码底图 - 始终显示 */}
|
||||
{/* 根据 wechatStatus 渲染不同的内容 */}
|
||||
{wechatStatus === WECHAT_STATUS.WAITING ? (
|
||||
<Image src={wechatAuthUrl} alt="微信二维码" boxSize="24" />
|
||||
<QRCodeSVG
|
||||
value={wechatAuthUrl}
|
||||
size={200}
|
||||
level="M"
|
||||
/>
|
||||
) : (
|
||||
<Icon as={FaQrcode} w={24} h={24} color="gray.300" />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user