mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 12:43:45 +08:00
This commit is contained in:
@@ -18,10 +18,7 @@ import (
|
||||
|
||||
// ApiAuth API鉴权中间件
|
||||
func (s *sMiddleware) ApiAuth(r *ghttp.Request) {
|
||||
|
||||
var (
|
||||
ctx = r.Context()
|
||||
)
|
||||
var ctx = r.Context()
|
||||
|
||||
// 替换掉模块前缀
|
||||
routerPrefix := g.Cfg().MustGet(ctx, "router.api.prefix", "/api")
|
||||
|
||||
@@ -97,9 +97,7 @@ func (s *sMiddleware) DemoLimit(r *ghttp.Request) {
|
||||
|
||||
// Addon 插件中间件
|
||||
func (s *sMiddleware) Addon(r *ghttp.Request) {
|
||||
var (
|
||||
ctx = r.Context()
|
||||
)
|
||||
var ctx = r.Context()
|
||||
|
||||
if contexts.Get(ctx).Module == "" {
|
||||
g.Log().Warning(ctx, "application module is not initialized.")
|
||||
|
||||
@@ -16,7 +16,7 @@ func (s *sMiddleware) Blacklist(r *ghttp.Request) {
|
||||
response.JsonExit(r, gcode.CodeServerBusy.Code(), "请求异常,已被封禁,如有疑问请联系管理员!")
|
||||
}
|
||||
} else {
|
||||
g.Log().Warningf(r.Context(), "blacklists uninitialized")
|
||||
g.Log().Infof(r.Context(), "blacklists uninitialized")
|
||||
}
|
||||
|
||||
r.Middleware.Next()
|
||||
|
||||
@@ -18,10 +18,7 @@ import (
|
||||
|
||||
// WebSocketToken 检查ws连接token
|
||||
func (s *sMiddleware) WebSocketToken(r *ghttp.Request) {
|
||||
|
||||
var (
|
||||
ctx = r.Context()
|
||||
)
|
||||
var ctx = r.Context()
|
||||
|
||||
// 替换掉模块前缀
|
||||
routerPrefix := g.Cfg().MustGet(ctx, "router.ws.prefix", "/socket")
|
||||
|
||||
Reference in New Issue
Block a user