refactor, replace beego.Error with logs.Error

This commit is contained in:
shiqstone
2021-03-30 14:24:14 +08:00
parent 0d5d2e4b38
commit 782ea44388
31 changed files with 454 additions and 464 deletions

View File

@@ -1,9 +1,9 @@
package controllers
import (
"github.com/astaxie/beego/logs"
"math"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
"github.com/mindoc-org/mindoc/models"
@@ -40,7 +40,7 @@ func (c *LabelController) Index() {
if err == orm.ErrNoRows {
c.Abort("404")
} else {
beego.Error(err)
logs.Error(err)
c.Abort("500")
}
}
@@ -51,7 +51,7 @@ func (c *LabelController) Index() {
searchResult, totalCount, err := models.NewBook().FindForLabelToPager(labelName, pageIndex, conf.PageSize, memberId)
if err != nil && err != orm.ErrNoRows {
beego.Error("查询标签时出错 ->", err)
logs.Error("查询标签时出错 ->", err)
c.ShowErrorPage(500, "查询文档列表时出错")
}
if totalCount > 0 {