This commit is contained in:
孟帅
2024-04-22 23:08:40 +08:00
parent 82483bd7b9
commit e144b12580
445 changed files with 17457 additions and 6708 deletions

View File

@@ -23,6 +23,7 @@ import (
"hotgo/internal/library/token"
"hotgo/internal/model"
"hotgo/internal/service"
"hotgo/utility/simple"
"hotgo/utility/validate"
"net/http"
"strings"
@@ -110,8 +111,7 @@ func (s *sMiddleware) CORS(r *ghttp.Request) {
// DemoLimit 演示系统操作限制
func (s *sMiddleware) DemoLimit(r *ghttp.Request) {
isDemo := g.Cfg().MustGet(r.Context(), "hotgo.isDemo", false)
if !isDemo.Bool() {
if !simple.IsDemo(r.Context()) {
r.Middleware.Next()
return
}
@@ -157,10 +157,6 @@ func (s *sMiddleware) Addon(r *ghttp.Request) {
return
}
if sk.View != nil {
r.SetView(sk.View)
}
contexts.SetAddonName(ctx, sk.Name)
r.Middleware.Next()
}

View File

@@ -82,7 +82,7 @@ func parseResponse(r *ghttp.Request) (code int, message string, resp interface{}
}
// 是否输出错误堆栈到页面
if g.Cfg().MustGet(ctx, "hotgo.debug", true).Bool() {
if simple.Debug(ctx) {
message = gerror.Current(err).Error()
if getContentType(r) == consts.HTTPContentTypeHtml {
resp = charset.SerializeStack(err)