修改回调用户名查询方式

This commit is contained in:
junleea 2024-07-09 10:10:03 +08:00
parent d692b8d9df
commit 22d0bffdf3
1 changed files with 2 additions and 2 deletions

View File

@ -171,8 +171,8 @@ func CIDCallback(c *gin.Context) {
}
res := dao.FindCIDByIDAndToken(cid, token)
if res.ID != 0 {
username, _ := c.Get("username")
go RunShell(username.(string), res.Url, res.Script, int(res.ID), res.Auth_id)
user := dao.FindUserByID(res.Auth_id)
go RunShell(user[0].Name, res.Url, res.Script, int(res.ID), res.Auth_id)
c.JSON(200, gin.H{"code": proto.SuccessCode, "message": "success", "data": "success"})
} else {
c.JSON(200, gin.H{"error": "CID not found by id and token", "code": proto.OperationFailed, "message": "failed"})