|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
using _24Hour.Model; |
|
|
|
using com.sun.xml.@internal.ws.api.model; |
|
|
|
using com.sun.xml.@internal.ws.api.model; |
|
|
|
using Elight.Entity; |
|
|
|
using Elight.Entity; |
|
|
|
using Elight.Logic; |
|
|
|
using Elight.Logic; |
|
|
@ -47,11 +48,19 @@ namespace _24Hour.Controllers |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost] |
|
|
|
[HttpPost] |
|
|
|
[Route("SystemLogin")] |
|
|
|
[Route("SystemLogin")] |
|
|
|
|
|
|
|
[CustomCorsActionFilterAttribute] |
|
|
|
public async Task<Result> SystemLogin(UserLogin login) |
|
|
|
public async Task<Result> SystemLogin(UserLogin login) |
|
|
|
{ |
|
|
|
{ |
|
|
|
try |
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
var Passmd5 = Md5.Encrypt32(login.Password).ToLower(); |
|
|
|
var Passmd5 = Md5.Encrypt32(login.Password).ToLower(); |
|
|
|
|
|
|
|
var model = await _db.Queryable<App_Sys_UserModel>().Where(x => x.phone== login.phone && x.IsDeleted==0).FirstAsync(); |
|
|
|
|
|
|
|
if (model == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ret.IsSucceed = false; |
|
|
|
|
|
|
|
ret.Message = "账号不存在,请先注册!"; |
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
} |
|
|
|
var date = await _db.Queryable<App_Sys_UserModel>().Where(q => q.IsDeleted == 0&&q.usertype==0 && q.isdeactivate == 0 && q.phone == login.phone&&q.Password== Passmd5).FirstAsync(); |
|
|
|
var date = await _db.Queryable<App_Sys_UserModel>().Where(q => q.IsDeleted == 0&&q.usertype==0 && q.isdeactivate == 0 && q.phone == login.phone&&q.Password== Passmd5).FirstAsync(); |
|
|
|
if (date != null) |
|
|
|
if (date != null) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -137,6 +146,7 @@ namespace _24Hour.Controllers |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost] |
|
|
|
[HttpPost] |
|
|
|
[Route("Login")] |
|
|
|
[Route("Login")] |
|
|
|
|
|
|
|
[CustomCorsActionFilterAttribute] |
|
|
|
public async Task<Result> Login(UserLogin login) |
|
|
|
public async Task<Result> Login(UserLogin login) |
|
|
|
{ |
|
|
|
{ |
|
|
|
try |
|
|
|
try |
|
|
@ -155,7 +165,7 @@ namespace _24Hour.Controllers |
|
|
|
if (Passmd5 != date.Password) |
|
|
|
if (Passmd5 != date.Password) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.Message = "账号或者密码错误!"; |
|
|
|
ret.Message = "账号或密码错误!"; |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
//else if (date.usertype == 1 && date.audit == null) |
|
|
|
//else if (date.usertype == 1 && date.audit == null) |
|
|
|