|
@@ -30,10 +30,10 @@ public class IdentityDomainService : IIdentityDomainService, IScopeDependency
|
|
|
随机数nonce60s内不能重复
|
|
|
*/
|
|
|
if (string.IsNullOrEmpty(request.Nonce)) return false;
|
|
|
- var now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
+ var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
|
|
_logger.LogInformation($"now:{now}, req:{request.Timestamp}");
|
|
|
if (request.Timestamp >= now) return false;
|
|
|
- if ((now - request.Timestamp) >= 60000) return false;
|
|
|
+ if ((now - request.Timestamp) >= 60) return false;
|
|
|
var nonce = _cacheAccountNonce.Get(request.Username)?.Nonce;
|
|
|
_logger.LogInformation($"nonce:{nonce}, reqnonce:{request.Nonce}");
|
|
|
if (!string.IsNullOrEmpty(nonce) && string.CompareOrdinal(nonce, request.Nonce) == 0) return false;
|