From 79cf18a2ef0ba621381ccab340ae5b9fc86c6d99 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sat, 24 May 2025 20:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=BB=9F=E4=B8=80=E5=88=A0=E9=99=A4=EF=BC=8C=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E6=89=80=E6=9C=89=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=B5=B0=E8=AE=A4=E8=AF=81=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 16 +++++++++------- main.go | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/handler/tool.go b/handler/tool.go index 7cd3ac4..c9cb011 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -58,14 +58,16 @@ func SetUpToolGroup(router *gin.Engine) { toolGroup.POST("/file_del", DelFile) //服务器、设备状态接口 toolGroup.POST("/monitor", SetDeviceStatusV2) - toolGroup.POST("/qq_callback", handleQQCallback) - toolGroup.GET("/qq_auth", GetQQAuthUrl) - toolGroup.GET("/github_auth", GetGithubAuthUrl) - toolGroup.GET("/get_auth_url", GetThirdPartyAuthUrl) - toolGroup.GET("/github_callback", handleGithubCallback) - toolGroup.GET("/gitee_callback", handleGiteeCallback) - toolGroup.GET("/third_party_callback", handleThirdPartyCallback) //统一处理第三方登录回调 + //第三方登录所有不进行,统一认证中心 + //toolGroup.POST("/qq_callback", handleQQCallback) + //toolGroup.GET("/qq_auth", GetQQAuthUrl) + //toolGroup.GET("/github_auth", GetGithubAuthUrl) + //toolGroup.GET("/get_auth_url", GetThirdPartyAuthUrl) + //toolGroup.GET("/github_callback", handleGithubCallback) + //toolGroup.GET("/gitee_callback", handleGiteeCallback) + //toolGroup.GET("/third_party_callback", handleThirdPartyCallback) //统一处理第三方登录回调 toolGroup.POST("/loginRedirect", LoginRedirect) + toolGroup.POST("/statistic", GetUserStatistic) //发送邮件 toolGroup.POST("/send_mail", SendMailTool) toolGroup.POST("/dashboard", DashBoardStatistics) diff --git a/main.go b/main.go index 4e81eb9..0767bc1 100644 --- a/main.go +++ b/main.go @@ -36,8 +36,8 @@ func main() { panic("failed to connect redis:" + err.Error()) } r.Use(handler.CrosHandler()) - r.Use(JWTAuthMiddleware()) // 使用 JWT 认证中间件 - handler.SetUpUserGroup(r) // User + r.Use(JWTAuthMiddleware()) // 使用 JWT 认证中间件 + //handler.SetUpUserGroup(r) // User,不进行用户信息,后面统一走认证中心 handler.SetUpToolGroup(r) // Tool handler.SetUpFileGroup(r) // File handler.SetUpKnowledgeBaseGroup(r) // KnowledgeBase