|
@@ -19,13 +19,14 @@ import (
|
|
|
func filterBefore(r *ghttp.Request) error {
|
|
|
ctx := router.GetGContext(r.GetCtx())
|
|
|
rule := ctx.RouterRule
|
|
|
+
|
|
|
+ //注入用户身份
|
|
|
+ infusionIdentity(r, ctx.Sess, rule.AppId)
|
|
|
+
|
|
|
if rule.SessCheck.NeedCheck() {
|
|
|
|
|
|
uCheck, eCheck := rule.SessCheck.CheckUserSession(), rule.SessCheck.CheckEntSession()
|
|
|
|
|
|
- //注入用户身份
|
|
|
- infusionIdentity(r, ctx.Sess, rule.AppId)
|
|
|
-
|
|
|
if uCheck && ctx.Sess.UserId == "" {
|
|
|
return NewErrorWithCode(GLOBAL_ERR_NOTLOGIN)
|
|
|
}
|