From 66f268cf173daaa008b00926193e5b4bd3d0644c Mon Sep 17 00:00:00 2001 From: moyin <244344649@qq.com> Date: Wed, 17 Dec 2025 20:23:51 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E7=A7=BB=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除重复的注册验证测试脚本 - 保持测试文件的整洁性 --- Test-Registration-With-Verification.ps1 | 59 ------------------------- 1 file changed, 59 deletions(-) delete mode 100644 Test-Registration-With-Verification.ps1 diff --git a/Test-Registration-With-Verification.ps1 b/Test-Registration-With-Verification.ps1 deleted file mode 100644 index 290d6fd..0000000 --- a/Test-Registration-With-Verification.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -# 测试带验证码的注册流程 -# 作者: moyin -# 日期: 2025-12-17 - -$baseUrl = "http://localhost:3000" -$testEmail = "test@example.com" - -Write-Host "=== 测试带验证码的注册流程 ===" -ForegroundColor Green - -# 步骤1: 发送邮箱验证码 -Write-Host "`n1. 发送邮箱验证码..." -ForegroundColor Yellow -$sendVerificationBody = @{ - email = $testEmail -} | ConvertTo-Json - -try { - $sendResponse = Invoke-RestMethod -Uri "$baseUrl/auth/send-email-verification" -Method POST -Body $sendVerificationBody -ContentType "application/json" - Write-Host "发送验证码响应: $($sendResponse | ConvertTo-Json -Depth 3)" -ForegroundColor Cyan - - if ($sendResponse.success) { - Write-Host "✓ 验证码发送成功" -ForegroundColor Green - - # 步骤2: 提示用户输入验证码 - Write-Host "`n2. 请输入收到的验证码..." -ForegroundColor Yellow - $verificationCode = Read-Host "验证码" - - # 步骤3: 使用验证码注册 - Write-Host "`n3. 使用验证码注册..." -ForegroundColor Yellow - $registerBody = @{ - username = "testuser_$(Get-Date -Format 'yyyyMMddHHmmss')" - password = "password123" - nickname = "测试用户" - email = $testEmail - email_verification_code = $verificationCode - } | ConvertTo-Json - - $registerResponse = Invoke-RestMethod -Uri "$baseUrl/auth/register" -Method POST -Body $registerBody -ContentType "application/json" - Write-Host "注册响应: $($registerResponse | ConvertTo-Json -Depth 3)" -ForegroundColor Cyan - - if ($registerResponse.success) { - Write-Host "✓ 注册成功!" -ForegroundColor Green - Write-Host "用户信息: $($registerResponse.data.user | ConvertTo-Json -Depth 2)" -ForegroundColor Cyan - } else { - Write-Host "✗ 注册失败: $($registerResponse.message)" -ForegroundColor Red - } - } else { - Write-Host "✗ 验证码发送失败: $($sendResponse.message)" -ForegroundColor Red - } -} catch { - Write-Host "✗ 请求失败: $($_.Exception.Message)" -ForegroundColor Red - if ($_.Exception.Response) { - $errorResponse = $_.Exception.Response.GetResponseStream() - $reader = New-Object System.IO.StreamReader($errorResponse) - $errorBody = $reader.ReadToEnd() - Write-Host "错误详情: $errorBody" -ForegroundColor Red - } -} - -Write-Host "`n=== 测试完成 ===" -ForegroundColor Green \ No newline at end of file