debug: 添加详细的登录调试日志
- 在后端login控制器中添加详细的执行步骤日志 - 添加错误捕获和处理,防止未捕获的异常 - 在前端LoginForm中添加详细的错误日志输出 - 在rate limiter中添加详细的限制日志 - 在请求日志中添加POST请求体信息 - 帮助定位401错误的具体原因 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -116,7 +116,14 @@ const handleLogin = async () => {
|
||||
|
||||
router.push('/dashboard')
|
||||
} catch (error: any) {
|
||||
console.log(error)
|
||||
console.error('登录失败,详细错误信息:', {
|
||||
status: error.response?.status,
|
||||
statusText: error.response?.statusText,
|
||||
data: error.response?.data,
|
||||
url: error.config?.url,
|
||||
method: error.config?.method,
|
||||
headers: error.config?.headers
|
||||
})
|
||||
// 根据不同的错误类型显示不同的错误信息
|
||||
if (error.response?.status === 401) {
|
||||
const errorMessage = error.response?.data?.error || '用户名或密码错误'
|
||||
|
||||
Reference in New Issue
Block a user