diff --git a/src/components/Auth/AuthFormContent.js b/src/components/Auth/AuthFormContent.js index 8343bd05..38feb673 100644 --- a/src/components/Auth/AuthFormContent.js +++ b/src/components/Auth/AuthFormContent.js @@ -35,11 +35,6 @@ import AuthHeader from './AuthHeader'; import VerificationCodeInput from './VerificationCodeInput'; import WechatRegister from './WechatRegister'; -// API配置 -const isProduction = process.env.NODE_ENV === 'production'; -// 使用空字符串让请求通过 webpack proxy,避免跨域 cookie 问题 -const API_BASE_URL = ""; - // 统一配置对象 const AUTH_CONFIG = { // UI文本 diff --git a/src/components/Auth/VerificationCodeInput.js b/src/components/Auth/VerificationCodeInput.js index 61b40c75..bc251055 100644 --- a/src/components/Auth/VerificationCodeInput.js +++ b/src/components/Auth/VerificationCodeInput.js @@ -18,6 +18,18 @@ export default function VerificationCodeInput({ colorScheme = "green", isRequired = true }) { + // 包装 onSendCode,确保所有错误都被捕获,防止被 ErrorBoundary 捕获 + const handleSendCode = async () => { + try { + if (onSendCode) { + await onSendCode(); + } + } catch (error) { + // 错误已经在父组件处理,这里只需要防止未捕获的 Promise rejection + console.error('Send code error (caught in VerificationCodeInput):', error); + } + }; + return ( @@ -30,7 +42,7 @@ export default function VerificationCodeInput({ />