fix:1、修复项目设置没有权限但团队可见的问题

2、修复删除项目团队失败的BUG
This commit is contained in:
lifei6671
2018-11-15 18:31:02 +08:00
parent 31b628060b
commit 2d3b0ab674
5 changed files with 14 additions and 9 deletions

View File

@@ -895,18 +895,22 @@ func (c *BookController) TeamDelete() {
teamId, _ := c.GetInt("teamId")
if teamId <= 0 {
c.JsonResult(5001,"参数错误")
}
book, err := c.IsPermission()
if err != nil {
c.JsonResult(500, err.Error())
c.JsonResult(5002, err.Error())
}
beego.Error(book)
err = models.NewTeamRelationship().DeleteByBookId(book.BookId, teamId)
if err != nil {
if err == orm.ErrNoRows {
c.JsonResult(500, "团队未加入项目")
c.JsonResult(5003, "团队未加入项目")
}
c.JsonResult(500, err.Error())
c.JsonResult(5004, err.Error())
}
c.JsonResult(0, "OK")
}