|
|
|
@ -142,6 +142,13 @@ namespace _24Hour.Controllers
|
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
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.isdeactivate == 0 && q.phone == login.phone && q.Password == Passmd5).FirstAsync(); |
|
|
|
|
if (date != null) |
|
|
|
|
{ |
|
|
|
@ -197,7 +204,7 @@ namespace _24Hour.Controllers
|
|
|
|
|
phone = date.phone, |
|
|
|
|
photo = date.photo, |
|
|
|
|
duties = date.duties, |
|
|
|
|
identity=date.identity, |
|
|
|
|
identity = date.identity, |
|
|
|
|
usertype = date.usertype, |
|
|
|
|
unitCode = date.unitCode, |
|
|
|
|
department = "", |
|
|
|
@ -371,25 +378,25 @@ namespace _24Hour.Controllers
|
|
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
|
[Route("cardIdLogin")] |
|
|
|
|
public async Task<Result> cardIdLogin(string cardId,string name) |
|
|
|
|
public async Task<Result> cardIdLogin(string cardId, string name) |
|
|
|
|
{ |
|
|
|
|
var date = await _db.Queryable<App_Sys_UserModel>().Where(q => q.IsDeleted == 0 && q.isdeactivate == 0 && q.cardId == cardId).FirstAsync(); |
|
|
|
|
if (date != null) |
|
|
|
|
{ |
|
|
|
|
//if (date.usertype == 1 && date.audit == null) |
|
|
|
|
// { |
|
|
|
|
// ret.IsSucceed = false; |
|
|
|
|
// ret.Message = "用户审核中!"; |
|
|
|
|
// return ret; |
|
|
|
|
// } |
|
|
|
|
// else if (date.usertype == 1 && date.audit == 1) |
|
|
|
|
// { |
|
|
|
|
// ret.IsSucceed = false; |
|
|
|
|
// ret.Message = $"用户审核未通过,原因:{date.describe}!"; |
|
|
|
|
// return ret; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
if (date.usertype == 0 && date.becurrent == 1) |
|
|
|
|
//if (date.usertype == 1 && date.audit == null) |
|
|
|
|
// { |
|
|
|
|
// ret.IsSucceed = false; |
|
|
|
|
// ret.Message = "用户审核中!"; |
|
|
|
|
// return ret; |
|
|
|
|
// } |
|
|
|
|
// else if (date.usertype == 1 && date.audit == 1) |
|
|
|
|
// { |
|
|
|
|
// ret.IsSucceed = false; |
|
|
|
|
// ret.Message = $"用户审核未通过,原因:{date.describe}!"; |
|
|
|
|
// return ret; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
if (date.usertype == 0 && date.becurrent == 1) |
|
|
|
|
{ |
|
|
|
|
ret.IsSucceed = false; |
|
|
|
|
ret.Message = $"用户未授权无法登录,请联系管理员!"; |
|
|
|
|