修复回调接口问题
This commit is contained in:
parent
9755d73b86
commit
65f98fe9de
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
3
main.go
3
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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue