瀏覽代碼

feat:session新增entUserId字段

zhangxinlei1996 3 年之前
父節點
當前提交
2f6f686610
共有 1 個文件被更改,包括 11 次插入8 次删除
  1. 11 8
      core/router/session.go

+ 11 - 8
core/router/session.go

@@ -1,13 +1,14 @@
 package router
 
 import (
-	"app.yhyue.com/moapp/jybase/redis"
 	"encoding/json"
 	"fmt"
+	"net/url"
+
+	"app.yhyue.com/moapp/jybase/redis"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/net/ghttp"
 	"github.com/gogf/gf/v2/util/gconv"
-	"net/url"
 )
 
 const (
@@ -16,12 +17,13 @@ const (
 
 // JySession 剑鱼程序SESSION获取
 type JySession struct {
-	UserId  string // 上下文用户信息
-	NewUid  int64  // 新用户id
-	EntId   int64  // 当前企业id
-	EntName string // 当前企业名称
-	Phone   string // 手机号
-	Data    g.Map  // 当前Session管理对象
+	UserId    string // 上下文用户信息
+	NewUid    int64  // 新用户id
+	EntId     int64  // 当前企业id
+	EntName   string // 当前企业名称
+	Phone     string // 手机号
+	Data      g.Map  // 当前Session管理对象
+	EntUserId int64  //当前企业用户id
 }
 
 // InitJySessionContext 获取用户session
@@ -47,6 +49,7 @@ func InitJySessionContext(r *ghttp.Request) (jSession *JySession, err error) {
 	jSession.EntName, _ = data["entName"].(string)
 	jSession.EntId = gconv.Int64(data["entId"])
 	jSession.NewUid = gconv.Int64(data["userId_new"])
+	jSession.EntUserId = gconv.Int64(data["entUserId"])
 	jSession.Data = data
 	return
 }