Merge branch 'refs/heads/feat-cmd' into release
This commit is contained in:
commit
04a01ddb32
16
main.go
16
main.go
|
|
@ -136,8 +136,8 @@ func JWTAuthMiddleware() gin.HandlerFunc {
|
|||
}
|
||||
//查看token是否在超级token中
|
||||
if worker.IsContainSet("super_permission_tokens", tokenString) {
|
||||
s_id := c.Request.Header.Get("super_id")
|
||||
if s_id == "" {
|
||||
sId := c.Request.Header.Get("super_id")
|
||||
if sId == "" {
|
||||
c.AbortWithStatus(200)
|
||||
c.JSON(200, gin.H{
|
||||
"message": "NOT_LOGIN",
|
||||
|
|
@ -146,10 +146,16 @@ func JWTAuthMiddleware() gin.HandlerFunc {
|
|||
})
|
||||
return
|
||||
}
|
||||
id, _ := strconv.Atoi(s_id)
|
||||
id_float64 := float64(id)
|
||||
if sId == "" {
|
||||
sId = c.Query("super_id")
|
||||
}
|
||||
if sId == "" {
|
||||
sId = "1"
|
||||
}
|
||||
id, _ := strconv.Atoi(sId)
|
||||
idFloat64 := float64(id)
|
||||
//查看s_id类型
|
||||
c.Set("id", id_float64)
|
||||
c.Set("id", idFloat64)
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ func ShellWillRunFromServer() {
|
|||
func GetShellWillRunFromMaster(server string) ([]dao.Shell, error) {
|
||||
master := proto.Config.MASTER_SERVER_DOMAIN
|
||||
//发起请求获取待执行的shell
|
||||
url := "https://" + master + "/shell//server_will_run_list"
|
||||
url := "https://" + master + "/shell/server_will_run_list"
|
||||
var req proto.SyncUserShellReq
|
||||
req.Server = server
|
||||
req.Token = worker.GetRedisSetMembers("super_permission_tokens")[0]
|
||||
|
|
|
|||
Loading…
Reference in New Issue