Skip to content

Commit 7936dc8

Browse files
committed
API认证超时时增加检查系统时钟提示
1 parent 94c4098 commit 7936dc8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/rpc/services/service_base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (this *BaseService) ValidateNodeId(ctx context.Context, roles ...rpcutils.U
160160
timestamp := m.GetInt64("timestamp")
161161
if time.Now().Unix()-timestamp > 600 {
162162
// 请求超过10分钟认为超时
163-
return rpcutils.UserTypeNone, 0, errors.New("authenticate timeout")
163+
return rpcutils.UserTypeNone, 0, errors.New("authenticate timeout, please check your system clock")
164164
}
165165

166166
switch apiToken.Role {

internal/rpc/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func ValidateRequest(ctx context.Context, userTypes ...UserType) (userType UserT
128128
timestamp := m.GetInt64("timestamp")
129129
if time.Now().Unix()-timestamp > 600 {
130130
// 请求超过10分钟认为超时
131-
return UserTypeNone, 0, errors.New("authenticate timeout")
131+
return UserTypeNone, 0, errors.New("authenticate timeout, please check your system clock")
132132
}
133133

134134
t := m.GetString("type")

0 commit comments

Comments
 (0)