mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
fix(config): use web.AppConfig instead of adapter
- use web.AppConfig, and change related codes TODO: handles errors
This commit is contained in:
@@ -7,9 +7,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/adapter"
|
||||
"github.com/beego/beego/v2/adapter/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"github.com/mindoc-org/mindoc/cache"
|
||||
"github.com/mindoc-org/mindoc/conf"
|
||||
"github.com/mindoc-org/mindoc/utils"
|
||||
@@ -273,7 +273,7 @@ func (b *Blog) Processor() *Blog {
|
||||
}
|
||||
})
|
||||
//设置图片为CDN地址
|
||||
if cdnimg := adapter.AppConfig.String("cdnimg"); cdnimg != "" {
|
||||
if cdnimg,_ := web.AppConfig.String("cdnimg"); cdnimg != "" {
|
||||
content.Find("img").Each(func(i int, contentSelection *goquery.Selection) {
|
||||
if src, ok := contentSelection.Attr("src"); ok && strings.HasPrefix(src, "/uploads/") {
|
||||
contentSelection.SetAttr("src", utils.JoinURI(cdnimg, src))
|
||||
|
||||
Reference in New Issue
Block a user