From af82111ae32d6292cf74e82e244f169220ccbebc Mon Sep 17 00:00:00 2001 From: wood chen Date: Mon, 3 Mar 2025 23:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BB=93=E6=9E=84=E4=BD=93=E4=B8=AD=E7=9A=84=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=A7=92=E8=89=B2=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/handlers/auth.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/handlers/auth.go b/backend/handlers/auth.go index a31c9b0..4df2212 100644 --- a/backend/handlers/auth.go +++ b/backend/handlers/auth.go @@ -176,8 +176,7 @@ func AuthCallback(c *gin.Context) { ID string `json:"id"` Email string `json:"email"` Username string `json:"username"` - Admin bool `json:"admin"` - AvatarURL string `json:"avatar_url"` + AvatarURL string `json:"avata"` Name string `json:"name"` } @@ -194,7 +193,7 @@ func AuthCallback(c *gin.Context) { &user.ID, &user.Username, &user.Email, &user.Role) role := "user" - if userInfo.Admin { + if userInfo.ID == "1" { // 这里写自己的用户ID role = "admin" }