Skip to content

Commit 62b3d98

Browse files
committed
feat: 修复一个小问题
1 parent 78a401c commit 62b3d98

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

internal/handler/auth.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ func AuthHandler(c *gin.Context) {
8787
c.JSON(http.StatusOK, gin.H{"code": 6, "msg": "跑步距离更新成功"})
8888
} else {
8989
// 距离数据相同:执行跑步
90+
if userInfo == nil {
91+
log.Printf("Login succeeded but userInfo is nil for account: %s", req.Account)
92+
c.JSON(http.StatusInternalServerError, gin.H{"code": 5, "msg": "内部服务器错误:无法获取用户信息"})
93+
return
94+
}
9095
if err := executeRunForUser(*userInfo, clientInfo, req.Account); err != nil {
9196
log.Printf("Failed to execute run for user %s: %v", req.Account, err)
9297
c.JSON(http.StatusInternalServerError, gin.H{"code": 5, "msg": "其他错误"})

runrun.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)