fix: 修复短信登录接口被调用时手机号或验证码为空时直接返回登录页面

This commit is contained in:
Argo Window10 2019-12-07 10:48:38 +08:00
parent 9c5064c4c3
commit 60d7f5d5ac
1 changed files with 2 additions and 0 deletions

View File

@ -93,6 +93,8 @@ namespace Bootstrap.Admin.Controllers
[HttpPost()]
public async Task<IActionResult> Mobile([FromServices]ISMSProvider provider, string phone, string code)
{
if (string.IsNullOrEmpty(phone) || string.IsNullOrEmpty(code)) return RedirectLogin();
var auth = provider.Validate(phone, code);
HttpContext.Log(phone, auth);
if (auth)