|
@@ -2,7 +2,6 @@ package router
|
|
|
|
|
|
import (
|
|
import (
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
- "context"
|
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
@@ -25,19 +24,6 @@ type JySession struct {
|
|
Data g.Map // 当前Session管理对象
|
|
Data g.Map // 当前Session管理对象
|
|
}
|
|
}
|
|
|
|
|
|
-// GetJySession 获取剑鱼程序session内容
|
|
|
|
-func GetJySession(ctx context.Context) (jSession *JySession) {
|
|
|
|
- jSession = &JySession{}
|
|
|
|
- value := ctx.Value(JY_SESSIONNAME)
|
|
|
|
- if value == nil {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if localCtx, ok := value.(*JySession); ok {
|
|
|
|
- jSession = localCtx
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// InitJySessionContext 获取用户session
|
|
// InitJySessionContext 获取用户session
|
|
func InitJySessionContext(r *ghttp.Request) (jSession *JySession, err error) {
|
|
func InitJySessionContext(r *ghttp.Request) (jSession *JySession, err error) {
|
|
jSession = &JySession{}
|
|
jSession = &JySession{}
|