mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 09:30:24 +08:00
API认证超时时增加检查系统时钟提示
This commit is contained in:
@@ -160,7 +160,7 @@ func (this *BaseService) ValidateNodeId(ctx context.Context, roles ...rpcutils.U
|
||||
timestamp := m.GetInt64("timestamp")
|
||||
if time.Now().Unix()-timestamp > 600 {
|
||||
// 请求超过10分钟认为超时
|
||||
return rpcutils.UserTypeNone, 0, errors.New("authenticate timeout")
|
||||
return rpcutils.UserTypeNone, 0, errors.New("authenticate timeout, please check your system clock")
|
||||
}
|
||||
|
||||
switch apiToken.Role {
|
||||
|
||||
@@ -128,7 +128,7 @@ func ValidateRequest(ctx context.Context, userTypes ...UserType) (userType UserT
|
||||
timestamp := m.GetInt64("timestamp")
|
||||
if time.Now().Unix()-timestamp > 600 {
|
||||
// 请求超过10分钟认为超时
|
||||
return UserTypeNone, 0, errors.New("authenticate timeout")
|
||||
return UserTypeNone, 0, errors.New("authenticate timeout, please check your system clock")
|
||||
}
|
||||
|
||||
t := m.GetString("type")
|
||||
|
||||
Reference in New Issue
Block a user