From 65f98fe9de63694e5a698cd1af4c51611d17f824 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Fri, 6 Dec 2024 19:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E8=B0=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/cid.go | 4 ++-- main.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/handler/cid.go b/handler/cid.go index ed5469f..15ad974 100644 --- a/handler/cid.go +++ b/handler/cid.go @@ -53,7 +53,7 @@ func SetUpCIDGroup(router *gin.Engine) { cidGroup.POST("/run", RunCID) cidGroup.POST("/log", GetCIDLogList) //获取执行日志 cidGroup.POST("/log/detail", GetCIDLog) //获取执行日志详情 - cidGroup.POST("/callback", CIDCallback) + cidGroup.GET("/callback", CIDCallback) } func RunCID(c *gin.Context) { var req CIDRunReq @@ -181,7 +181,7 @@ func CIDCallback(c *gin.Context) { // 获取用户ID token := c.Query("token") cid_id := c.Query("id") - fmt.Println("token:", token, "cid_id:", cid_id) + //fmt.Println("token:", token, "cid_id:", cid_id) //将cid转换为int cid, _ := strconv.Atoi(cid_id) diff --git a/main.go b/main.go index 186785d..591e17d 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "github.com/robfig/cron/v3" "io" "log" + "net/http" "os" "strings" "videoplayer/dao" @@ -168,7 +169,7 @@ func JWTAuthMiddleware() gin.HandlerFunc { if UserFuncIntercept(int(token.Claims.(jwt.MapClaims)["id"].(float64)), c.Request.URL.Path) { c.AbortWithStatus(200) - c.JSON(200, gin.H{ + c.JSON(http.StatusOK, gin.H{ "message": "no function permission", "error": "no permission", "code": proto.NoPermission,