fix:修复mysql兼容问题

This commit is contained in:
lifei6671
2018-11-26 18:54:50 +08:00
parent a64a6c80e6
commit 1b6c7e4793
9 changed files with 57 additions and 38 deletions

View File

@@ -183,7 +183,7 @@ func (c *DocumentController) Edit() {
bookResult := models.NewBookResult()
var err error
// 如果是超级管理者,则不判断权限
// 如果是管理者,则不判断权限
if c.Member.IsAdministrator() {
book, err := models.NewBook().FindByFieldFirst("identify", identify)
if err != nil {
@@ -195,7 +195,7 @@ func (c *DocumentController) Edit() {
bookResult, err = models.NewBookResult().FindByIdentify(identify, c.Member.MemberId)
if err != nil {
if err == orm.ErrNoRows {
if err == orm.ErrNoRows || err == models.ErrPermissionDenied{
c.ShowErrorPage(403, "项目不存在或没有权限")
} else {
beego.Error("查询项目时出错 -> ", err)