mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-18 17:48:00 +08:00
fix(all): don't use adapter in FuncMap and Filter etc.
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/mindoc-org/mindoc/conf"
|
||||
@@ -160,7 +159,7 @@ func (c *BaseController) ExecuteViewPathTemplate(tplName string, data interface{
|
||||
|
||||
}
|
||||
|
||||
if err := adapter.ExecuteViewPathTemplate(&buf, tplName, viewPath, data); err != nil {
|
||||
if err := web.ExecuteViewPathTemplate(&buf, tplName, viewPath, data); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return buf.String(), nil
|
||||
@@ -187,7 +186,7 @@ func (c *BaseController) ShowErrorPage(errCode int, errMsg string) {
|
||||
|
||||
var buf bytes.Buffer
|
||||
|
||||
if err := adapter.ExecuteViewPathTemplate(&buf, "errors/error.tpl", web.BConfig.WebConfig.ViewsPath, map[string]interface{}{"ErrorMessage": errMsg, "ErrorCode": errCode, "BaseUrl": conf.BaseUrl}); err != nil {
|
||||
if err := web.ExecuteViewPathTemplate(&buf, "errors/error.tpl", web.BConfig.WebConfig.ViewsPath, map[string]interface{}{"ErrorMessage": errMsg, "ErrorCode": errCode, "BaseUrl": conf.BaseUrl}); err != nil {
|
||||
c.Abort("500")
|
||||
}
|
||||
if errCode >= 200 && errCode <= 510 {
|
||||
|
@@ -13,9 +13,9 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/mindoc-org/mindoc/conf"
|
||||
"github.com/mindoc-org/mindoc/models"
|
||||
"github.com/mindoc-org/mindoc/utils"
|
||||
@@ -751,7 +751,7 @@ func (c *ManagerController) Config() {
|
||||
|
||||
tf.WriteString(content)
|
||||
|
||||
err = adapter.LoadAppConfig("ini", tf.Name())
|
||||
err = web.LoadAppConfig("ini", tf.Name())
|
||||
|
||||
if err != nil {
|
||||
logs.Error("加载配置文件失败 ->", err)
|
||||
|
Reference in New Issue
Block a user