优化home模块页面错误处理

This commit is contained in:
孟帅
2023-06-15 20:40:19 +08:00
parent 5abfeb5485
commit 2d0d7e5604
14 changed files with 509 additions and 397 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/gogf/gf/v2/encoding/gbase64"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/glog"
"github.com/gogf/gf/v2/os/grpool"
"github.com/gogf/gf/v2/util/gconv"
@@ -46,6 +47,11 @@ func FilterMaskDemo(ctx context.Context, src g.Map) g.Map {
return src
}
// DefaultErrorTplContent 获取默认的错误模板内容
func DefaultErrorTplContent(ctx context.Context) string {
return gfile.GetContents(g.Cfg().MustGet(ctx, "viewer.paths").String() + "/error/default.html")
}
// DecryptText 解密文本
func DecryptText(text string) (string, error) {
str, err := gbase64.Decode([]byte(text))