Compare commits

...

2 Commits

Author SHA1 Message Date
junleea 15507c6cfc cid 删除控制台输出 2024-10-08 13:57:03 +08:00
junleea edb24274e6 修复cid回调判断 2024-08-04 21:27:38 +08:00
1 changed files with 5 additions and 1 deletions

View File

@ -178,6 +178,10 @@ func CIDCallback(c *gin.Context) {
return return
} }
res := dao.FindCIDByIDAndToken(cid, token) res := dao.FindCIDByIDAndToken(cid, token)
if res.ID == 0 {
c.JSON(200, gin.H{"error": "CID not found by id and token", "code": proto.OperationFailed, "message": "failed"})
return
}
user := dao.FindUserByUserID(res.Auth_id) user := dao.FindUserByUserID(res.Auth_id)
if user.Run == false { if user.Run == false {
@ -215,6 +219,6 @@ echo "end"`
if err3 != nil { if err3 != nil {
err3_info = err3.Error() err3_info = err3.Error()
} }
fmt.Println("bash content:", scriptContent) //fmt.Println("bash content:", scriptContent)
dao.CreateRunLog(id, authID, scriptContent, out.String(), err3_info) //添加执行日志 dao.CreateRunLog(id, authID, scriptContent, out.String(), err3_info) //添加执行日志
} }