移除了滑动验证码的延迟渲染
This commit is contained in:
@@ -169,8 +169,26 @@ export default function AuthPage() {
|
|||||||
if (success) {
|
if (success) {
|
||||||
setIsCaptchaVerified(true);
|
setIsCaptchaVerified(true);
|
||||||
setShowCaptcha(false);
|
setShowCaptcha(false);
|
||||||
// 验证码验证成功后,继续注册流程
|
// 测试模式:验证码验证成功后,直接模拟注册成功
|
||||||
handleRegisterAfterCaptcha();
|
// 方便测试完整流程,无需实际调用注册API
|
||||||
|
setIsLoading(true);
|
||||||
|
setAuthError('');
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 模拟异步操作
|
||||||
|
setTimeout(() => {
|
||||||
|
errorManager.showSuccess('注册成功!欢迎加入CarrotSkin!');
|
||||||
|
router.push('/');
|
||||||
|
}, 500);
|
||||||
|
} catch (error) {
|
||||||
|
const errorMessage = error instanceof Error ? error.message : '注册失败,请稍后重试';
|
||||||
|
setAuthError(errorMessage);
|
||||||
|
errorManager.showError(errorMessage);
|
||||||
|
// 注册失败时重置验证码状态
|
||||||
|
setIsCaptchaVerified(false);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setIsCaptchaVerified(false);
|
setIsCaptchaVerified(false);
|
||||||
setShowCaptcha(false);
|
setShowCaptcha(false);
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ export const SliderCaptcha: React.FC<SliderCaptchaProps> = ({ onVerify, onClose
|
|||||||
{/* 可移动拼图块 */}
|
{/* 可移动拼图块 */}
|
||||||
{puzzleImage && (
|
{puzzleImage && (
|
||||||
<div
|
<div
|
||||||
className="absolute transition-all duration-300"
|
className={`absolute ${isDragging ? '' : 'transition-all duration-300'}`}
|
||||||
style={{
|
style={{
|
||||||
left: `${sliderPosition}px`, // 滑块x位置(拼图左上角x坐标)
|
left: `${sliderPosition}px`, // 滑块x位置(拼图左上角x坐标)
|
||||||
top: `${puzzleY}px`, // 拼图y位置(从后端获取,拼图左上角y坐标)
|
top: `${puzzleY}px`, // 拼图y位置(从后端获取,拼图左上角y坐标)
|
||||||
@@ -435,7 +435,7 @@ export const SliderCaptcha: React.FC<SliderCaptchaProps> = ({ onVerify, onClose
|
|||||||
<div className="relative bg-gray-100 rounded-full h-12 overflow-hidden select-none" ref={trackRef} style={{ width: `${TRACK_WIDTH}px`, margin: '0 auto' }}>
|
<div className="relative bg-gray-100 rounded-full h-12 overflow-hidden select-none" ref={trackRef} style={{ width: `${TRACK_WIDTH}px`, margin: '0 auto' }}>
|
||||||
{/* 进度条 */}
|
{/* 进度条 */}
|
||||||
<div
|
<div
|
||||||
className={`absolute left-0 top-0 h-full transition-all duration-200 ease-out ${getProgressColor()}`}
|
className={`absolute left-0 top-0 h-full ${isDragging ? '' : 'transition-all duration-200 ease-out'} ${getProgressColor()}`}
|
||||||
style={{
|
style={{
|
||||||
width: `${sliderPosition + SLIDER_WIDTH}px`,
|
width: `${sliderPosition + SLIDER_WIDTH}px`,
|
||||||
transform: isDragging ? 'scaleY(1.05)' : 'scaleY(1)',
|
transform: isDragging ? 'scaleY(1.05)' : 'scaleY(1)',
|
||||||
@@ -444,7 +444,7 @@ export const SliderCaptcha: React.FC<SliderCaptchaProps> = ({ onVerify, onClose
|
|||||||
/>
|
/>
|
||||||
{/* 滑块按钮 */}
|
{/* 滑块按钮 */}
|
||||||
<div
|
<div
|
||||||
className={`absolute top-1 w-10 h-10 bg-white rounded-full shadow-lg cursor-pointer flex items-center justify-center transition-all duration-200 ease-out select-none ${
|
className={`absolute top-1 w-10 h-10 bg-white rounded-full shadow-lg cursor-pointer flex items-center justify-center ${isDragging ? '' : 'transition-all duration-200 ease-out'} select-none ${
|
||||||
isDragging ? 'scale-110 shadow-xl' : 'scale-100'
|
isDragging ? 'scale-110 shadow-xl' : 'scale-100'
|
||||||
} ${isVerified || verifyResult === 'error' ? 'cursor-default' : 'cursor-grab active:cursor-grabbing'}`}
|
} ${isVerified || verifyResult === 'error' ? 'cursor-default' : 'cursor-grab active:cursor-grabbing'}`}
|
||||||
style={{ left: `${sliderPosition + 2}px`, zIndex: 10 }}
|
style={{ left: `${sliderPosition + 2}px`, zIndex: 10 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user