清理代码
This commit is contained in:
parent
87a8c989bf
commit
854d367ff1
@ -38,9 +38,9 @@ public class OAuthController : IDynamicApiController
|
||||
[AllowAnonymous]
|
||||
public async Task<MiniProgramLoginOutput> Login([FromBody] MiniProgramLoginInput input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.Password) && string.IsNullOrEmpty(input.VerificationCode))
|
||||
if (string.IsNullOrEmpty(input.Password) )
|
||||
{
|
||||
throw Oops.Bah("密码和验证码至少提供一个");
|
||||
throw Oops.Bah("密码必填");
|
||||
}
|
||||
|
||||
var appUser = await _appUserRepository.GetFirstAsync(x => x.Mobile == input.Mobile);
|
||||
@ -62,17 +62,6 @@ public class OAuthController : IDynamicApiController
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(input.VerificationCode))
|
||||
{
|
||||
var cacheKey = $"{SmsCodeCachePrefix}{input.Mobile}";
|
||||
string cachedCode = null;
|
||||
if (!_memoryCache.TryGetValue(cacheKey, out cachedCode) || cachedCode != input.VerificationCode)
|
||||
{
|
||||
throw Oops.Bah("验证码错误或已过期");
|
||||
}
|
||||
_memoryCache.Remove(cacheKey);
|
||||
}
|
||||
|
||||
(string accessToken, string refreshToken) = GenerateTokens(appUser);
|
||||
|
||||
var userInfo = new
|
||||
|
||||
@ -2092,12 +2092,7 @@
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Client.Dtos.MiniProgramLoginInput.Password">
|
||||
<summary>
|
||||
密码(可选,与验证码至少提供一个)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Client.Dtos.MiniProgramLoginInput.VerificationCode">
|
||||
<summary>
|
||||
验证码(可选,与密码至少提供一个)
|
||||
密码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Client.Dtos.MiniProgramLoginOutput">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user