|
|
|
@ -3,6 +3,7 @@ package interceptor |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"key_performance_indicators/middleware/grocerystore" |
|
|
|
"key_performance_indicators/models/modelshr" |
|
|
|
"key_performance_indicators/models/modelssystempermission" |
|
|
|
"key_performance_indicators/overall" |
|
|
|
"key_performance_indicators/overall/publicmethod" |
|
|
|
@ -37,13 +38,17 @@ func AuthenticateUser() gin.HandlerFunc { |
|
|
|
c.Abort() |
|
|
|
return |
|
|
|
} |
|
|
|
myCont, myErr := publicmethod.GetUserRedisCont(userRedisToken["usernumber"]) |
|
|
|
// myCont, myErr := publicmethod.GetUserRedisCont(userRedisToken["usernumber"])
|
|
|
|
var myCont modelshr.ManCont |
|
|
|
myErr := myCont.GetCont(map[string]interface{}{"`number`": userRedisToken["usernumber"]}) |
|
|
|
if myErr != nil { |
|
|
|
response.FailWithDetailed(gin.H{"reload": false, "code": 303, "data": myErr}, "登录超时!请重新登录", c) |
|
|
|
c.Abort() |
|
|
|
return |
|
|
|
} |
|
|
|
// fmt.Printf("myCont---------------->%v\n", myCont)
|
|
|
|
|
|
|
|
// myContJson, _ := json.Marshal(myCont)
|
|
|
|
// fmt.Printf("myCont---------------->%v\n", string(myContJson))
|
|
|
|
c.Set(overall.MyContJwt, myCont) |
|
|
|
writeRedisData := publicmethod.MapOut[string]() |
|
|
|
for i, v := range userRedisToken { |
|
|
|
@ -102,6 +107,11 @@ func AuthenticateUser() gin.HandlerFunc { |
|
|
|
myContRedis["planformaldate"] = myCont.Planformaldate //预计转正日期
|
|
|
|
myContRedis["political_outlook"] = myCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)
|
|
|
|
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, myCont.Number) |
|
|
|
|
|
|
|
// fmt.Printf("redisMyContKey------------>%v\n", redisMyContKey)
|
|
|
|
// myContRedisJson, _ := json.Marshal(myContRedis)
|
|
|
|
// fmt.Printf("myContRedisJson------------>%v\n", string(myContRedisJson))
|
|
|
|
|
|
|
|
redisClient.HashMsetAdd(redisMyContKey, myContRedis) |
|
|
|
c.Next() |
|
|
|
} |
|
|
|
|