正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
@@ -25,6 +25,7 @@ func SetLoginToken(param protocol.LoginAuthToken, userid int64, companyid int64) | @@ -25,6 +25,7 @@ func SetLoginToken(param protocol.LoginAuthToken, userid int64, companyid int64) | ||
25 | value, _ = json.Marshal(data) | 25 | value, _ = json.Marshal(data) |
26 | 26 | ||
27 | key = GetKeyLoginToken(userid, companyid) | 27 | key = GetKeyLoginToken(userid, companyid) |
28 | + client.Del(key) | ||
28 | err = client.Set(key, string(value), LOGIN_TOKEN_EXP).Err() | 29 | err = client.Set(key, string(value), LOGIN_TOKEN_EXP).Err() |
29 | return err | 30 | return err |
30 | } | 31 | } |
@@ -89,6 +90,7 @@ func RefreshLoginTokenExpires(userid int64, companyid int64) error { | @@ -89,6 +90,7 @@ func RefreshLoginTokenExpires(userid int64, companyid int64) error { | ||
89 | func SetCaptchAuth(phone string, captchAuth string) error { | 90 | func SetCaptchAuth(phone string, captchAuth string) error { |
90 | key := GetKeyCaptchAuth(phone) | 91 | key := GetKeyCaptchAuth(phone) |
91 | client := redis.GetRedis() | 92 | client := redis.GetRedis() |
93 | + client.Del(key) | ||
92 | err := client.Set(key, captchAuth, CAPTCHA_AUTH_EXP).Err() | 94 | err := client.Set(key, captchAuth, CAPTCHA_AUTH_EXP).Err() |
93 | return err | 95 | return err |
94 | } | 96 | } |
@@ -103,6 +105,7 @@ func GetCaptchAuth(phone string) (string, error) { | @@ -103,6 +105,7 @@ func GetCaptchAuth(phone string) (string, error) { | ||
103 | func SetUserPermission(objMap map[string]rbac.PermissionOptionObject, userid int64) error { | 105 | func SetUserPermission(objMap map[string]rbac.PermissionOptionObject, userid int64) error { |
104 | key := GetKeyUserPermission(userid) | 106 | key := GetKeyUserPermission(userid) |
105 | client := redis.GetRedis() | 107 | client := redis.GetRedis() |
108 | + client.Del(key) | ||
106 | for k := range objMap { | 109 | for k := range objMap { |
107 | s, err := json.Marshal(objMap[k]) | 110 | s, err := json.Marshal(objMap[k]) |
108 | if err != nil { | 111 | if err != nil { |
-
请 注册 或 登录 后发表评论