From 0e638e21c1c306f3d9a0fccfc02df82d5f3a114d Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 16 Oct 2025 15:35:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E4=BF=A1=E7=99=BB=E9=99=86?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Auth/WechatRegister.js | 6 +++--- src/components/Navbars/HomeNavbar.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Auth/WechatRegister.js b/src/components/Auth/WechatRegister.js index f467de41..9ee54ffa 100644 --- a/src/components/Auth/WechatRegister.js +++ b/src/components/Auth/WechatRegister.js @@ -211,12 +211,12 @@ export default function WechatRegister() { throw new Error('服务器无响应'); } - if (response.code !== 0) { + if (!response.auth_url) { throw new Error('获取二维码失败'); } - setWechatAuthUrl(response.data.auth_url); - setWechatSessionId(response.data.session_id); + setWechatAuthUrl(response.auth_url); + setWechatSessionId(response.session_id); setWechatStatus(WECHAT_STATUS.WAITING); // 启动轮询检查扫码状态 diff --git a/src/components/Navbars/HomeNavbar.js b/src/components/Navbars/HomeNavbar.js index 60395b90..a106fb07 100644 --- a/src/components/Navbars/HomeNavbar.js +++ b/src/components/Navbars/HomeNavbar.js @@ -46,7 +46,7 @@ import { useAuthModal } from '../../contexts/AuthModalContext'; const NavItems = ({ isAuthenticated, user }) => { const navigate = useNavigate(); - if (!isAuthenticated && !user) { + if (isAuthenticated && user) { return (