From 7438f17c0b3a9f79ee5890c554bedc64c362859b Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 13 十月 2023 14:04:59 +0800
Subject: [PATCH] 销售计划简单数据权限

---
 middleware/jwt.go |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/middleware/jwt.go b/middleware/jwt.go
index 35509b7..ec143b0 100644
--- a/middleware/jwt.go
+++ b/middleware/jwt.go
@@ -105,9 +105,14 @@
 			c.Next()
 			return
 		}
-
+		userInfo := service.GetUserBaseCache(claims.UserId)
+		if userInfo == nil {
+			SyncUserInfo()
+			userInfo = service.GetUserBaseCache(claims.UserId)
+		}
+		claims.CrmUserId = userInfo.UserId
+		claims.NickName = userInfo.NickName
 		c.Set("claims", claims)
-
 		if CheckAuth(c.Request.RequestURI, token) {
 			c.Next()
 		} else {

--
Gitblit v1.8.0