|
|
|
@ -4,7 +4,6 @@ using Infrastructure.Application.Services.Settings;
|
|
|
|
|
using Infrastructure.Data;
|
|
|
|
|
using Infrastructure.Email;
|
|
|
|
|
using Infrastructure.Extensions;
|
|
|
|
|
using Infrastructure.Resources;
|
|
|
|
|
using Infrastructure.Security;
|
|
|
|
|
using Infrastructure.Sms;
|
|
|
|
|
using Infrastructure.Web;
|
|
|
|
@ -15,7 +14,6 @@ using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
@ -34,7 +32,6 @@ namespace UserCenter.Controllers
|
|
|
|
|
private readonly ISettingService _settingService;
|
|
|
|
|
private readonly IRepository<User> _userRepo;
|
|
|
|
|
private readonly IRepository<Site> _siteRepo;
|
|
|
|
|
private readonly IStringLocalizer<Resource> _localizer;
|
|
|
|
|
private readonly IEncryptionService _encryptionService;
|
|
|
|
|
private readonly IEmailSender _emailSender;
|
|
|
|
|
private readonly ISmsSender _smsSender;
|
|
|
|
@ -45,7 +42,6 @@ namespace UserCenter.Controllers
|
|
|
|
|
IRepository<User> userRepo,
|
|
|
|
|
IRepository<Site> siteRepo,
|
|
|
|
|
IEncryptionService encryptionService,
|
|
|
|
|
IStringLocalizer<Resource> localizer,
|
|
|
|
|
IEmailSender emaliSender,
|
|
|
|
|
ISmsSender smsSender
|
|
|
|
|
//FaceRecognitionService frs
|
|
|
|
@ -56,7 +52,6 @@ namespace UserCenter.Controllers
|
|
|
|
|
this._userRepo = userRepo;
|
|
|
|
|
this._siteRepo = siteRepo;
|
|
|
|
|
this._encryptionService = encryptionService;
|
|
|
|
|
this._localizer = localizer;
|
|
|
|
|
this._emailSender = emaliSender;
|
|
|
|
|
this._smsSender = smsSender;
|
|
|
|
|
//this._frs = frs;
|
|
|
|
@ -228,7 +223,7 @@ namespace UserCenter.Controllers
|
|
|
|
|
#region 注册
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public JsonResult UserNameNotUsed([Required]string userName)
|
|
|
|
|
public JsonResult UserNameNotUsed([Required] string userName)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
@ -292,7 +287,7 @@ namespace UserCenter.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public JsonResult EmailNotUsed([Required]string email)
|
|
|
|
|
public JsonResult EmailNotUsed([Required] string email)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
@ -302,7 +297,7 @@ namespace UserCenter.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public JsonResult SendCodeToEmail([Required]string email)
|
|
|
|
|
public JsonResult SendCodeToEmail([Required] string email)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
@ -383,7 +378,7 @@ namespace UserCenter.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public JsonResult PhoneNumberNotUsed([Required]string phoneNumber)
|
|
|
|
|
public JsonResult PhoneNumberNotUsed([Required] string phoneNumber)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
@ -393,7 +388,7 @@ namespace UserCenter.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public JsonResult SendCodeToPhoneNumber([Required]string phoneNumber)
|
|
|
|
|
public JsonResult SendCodeToPhoneNumber([Required] string phoneNumber)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
@ -450,7 +445,7 @@ namespace UserCenter.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public JsonResult HasUser([Required]string userName)
|
|
|
|
|
public JsonResult HasUser([Required] string userName)
|
|
|
|
|
{
|
|
|
|
|
if (ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
|