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,