From d4aebb8148e4e1477df72bae82d206bf52083716 Mon Sep 17 00:00:00 2001 From: wood chen Date: Fri, 14 Feb 2025 23:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20OAuth=20=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=20URL=20=E4=BB=A5=E4=BD=BF=E7=94=A8=E6=96=B0=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 8 ++++---- backend/handlers/auth.go | 8 ++++---- frontend/src/App.vue | 2 +- frontend/src/views/Home.vue | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index f53293b..932e8e1 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ PORT=8080 GIN_MODE=debug OAUTH_CLIENT_ID=your_client_id_here OAUTH_CLIENT_SECRET=your_client_secret_here -OAUTH_REDIRECT_URI=https://aimodels-prices.q58.pro/api/auth/callback -OAUTH_AUTHORIZE_URL=https://connect.q58.pro/oauth/authorize -OAUTH_TOKEN_URL=https://connect.q58.pro/api/oauth/access_token -OAUTH_USER_URL=https://connect.q58.pro/api/oauth/user \ No newline at end of file +OAUTH_REDIRECT_URI=https://aimodels-prices.q58.club/api/auth/callback +OAUTH_AUTHORIZE_URL=https://connect.q58.club/oauth/authorize +OAUTH_TOKEN_URL=https://connect.q58.club/api/oauth/access_token +OAUTH_USER_URL=https://connect.q58.club/api/oauth/user \ No newline at end of file diff --git a/backend/handlers/auth.go b/backend/handlers/auth.go index 173ecdd..be49c08 100644 --- a/backend/handlers/auth.go +++ b/backend/handlers/auth.go @@ -91,7 +91,7 @@ func Login(c *gin.Context) { } // 设置cookie - c.SetCookie("session", sessionID, int(24*time.Hour.Seconds()), "/", "aimodels-prices.q58.pro", true, true) + c.SetCookie("session", sessionID, int(24*time.Hour.Seconds()), "/", "aimodels-prices.q58.club", true, true) c.JSON(http.StatusOK, gin.H{"message": "Logged in successfully"}) return } @@ -125,7 +125,7 @@ func Logout(c *gin.Context) { db.Exec("DELETE FROM session WHERE id = ?", cookie) } - c.SetCookie("session", "", -1, "/", "aimodels-prices.q58.pro", true, true) + c.SetCookie("session", "", -1, "/", "aimodels-prices.q58.club", true, true) c.JSON(http.StatusOK, gin.H{"message": "Logged out successfully"}) } @@ -281,8 +281,8 @@ func AuthCallback(c *gin.Context) { } // 设置 cookie - c.SetCookie("session", sessionID, int(24*time.Hour.Seconds()), "/", "aimodels-prices.q58.pro", true, true) + c.SetCookie("session", sessionID, int(24*time.Hour.Seconds()), "/", "aimodels-prices.q58.club", true, true) // 重定向到前端 - c.Redirect(http.StatusTemporaryRedirect, "https://aimodels-prices.q58.pro") + c.Redirect(http.StatusTemporaryRedirect, "https://aimodels-prices.q58.club") } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 1172409..2b57116 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -35,7 +35,7 @@ diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index 5b1d56f..07b543c 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -20,7 +20,7 @@

交流讨论

-

请在帖子下留言: https://q58.pro/t/topic/277

+

请在帖子下留言: https://q58.club/t/topic/277

API文档