Squashed commit of the following: 修改权限过期时间
commit d833d2d4 Author: yangfu <785409885@qq.com> Date: Mon May 18 14:12:16 2020 +0800 修改权限过期时间 commit d72f9c03 Author: yangfu <785409885@qq.com> Date: Mon May 18 14:00:10 2020 +0800 修改权限过期时间 commit de50130d Author: yangfu <785409885@qq.com> Date: Mon May 18 11:14:08 2020 +0800 修改权限过期时间
正在显示
2 个修改的文件
包含
7 行增加
和
1 行删除
@@ -15,7 +15,7 @@ const ( | @@ -15,7 +15,7 @@ const ( | ||
15 | DeviceType = 1 | 15 | DeviceType = 1 |
16 | ) | 16 | ) |
17 | 17 | ||
18 | -const TokenExpire = 3600 | 18 | +const TokenExpire = 60 * 15 |
19 | const RefreshTokenExipre = 3600 * 24 * 30 * 3 //刷新token 三个月过期 | 19 | const RefreshTokenExipre = 3600 * 24 * 30 * 3 //刷新token 三个月过期 |
20 | 20 | ||
21 | const SmscodeDayLimitTime = 10 //短信验证码每天最多发10次 | 21 | const SmscodeDayLimitTime = 10 //短信验证码每天最多发10次 |
@@ -569,6 +569,12 @@ func RefreshToken(request *protocol.RefreshTokenRequest) (rsp *protocol.RefreshT | @@ -569,6 +569,12 @@ func RefreshToken(request *protocol.RefreshTokenRequest) (rsp *protocol.RefreshT | ||
569 | err = protocol.NewErrWithMessage(4140, err) | 569 | err = protocol.NewErrWithMessage(4140, err) |
570 | return | 570 | return |
571 | } | 571 | } |
572 | + //注入用户二次鉴权 | ||
573 | + if authMessage, hasAuth := agg.GetUserModuleAuth(userAuth.CurrentUserCompanyId); !hasAuth && userAuth.CurrentUserCompanyId > 0 { | ||
574 | + log.Error(authMessage.Errno, authMessage.Errmsg) | ||
575 | + err = protocol.NewErrWithMessage(4140, err) //账号不存在 | ||
576 | + return | ||
577 | + } | ||
572 | //userAuth.AccessToken = uid.NewV1().StringNoDash() | 578 | //userAuth.AccessToken = uid.NewV1().StringNoDash() |
573 | userAuth.AccessToken = uid.NewV1().StringNoDash() | 579 | userAuth.AccessToken = uid.NewV1().StringNoDash() |
574 | userAuth.RefreshToken = uid.NewV1().StringNoDash() | 580 | userAuth.RefreshToken = uid.NewV1().StringNoDash() |
-
请 注册 或 登录 后发表评论