错误5次以上需要重新获取验证码
This commit is contained in:
@@ -355,6 +355,18 @@ namespace Vote.Services.ApiController
|
||||
var token = await HandlerLoginAsync(args);
|
||||
return new { passed, token };
|
||||
}
|
||||
//记录错误次数 错误5次以上需要重新获取验证码
|
||||
var errorCount = _memoryCache.Get<int>("cache_code_error_count:" + args.phone);
|
||||
if (errorCount >= 5)
|
||||
{
|
||||
await repSmsCode.Context.Updateable<nbzc_sms_code>().SetColumns(a => a.IsDeleted == true).Where(a => a.phone == args.phone).ExecuteCommandAsync();
|
||||
_memoryCache.Remove("cache_code_error_count:" + args.phone);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorCount++;
|
||||
_memoryCache.Set<int>("cache_code_error_count:" + args.phone, errorCount);
|
||||
}
|
||||
return new { passed, token = "" };
|
||||
}
|
||||
private async Task<string> HandlerLoginAsync(VerifyLoginInput args)
|
||||
|
||||
Reference in New Issue
Block a user