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()
}