|
|
@ -435,7 +435,7 @@ namespace _24Hour.Controllers |
|
|
|
//} |
|
|
|
//} |
|
|
|
if (string.IsNullOrEmpty(UserModel.wechatId) == false) |
|
|
|
if (string.IsNullOrEmpty(UserModel.wechatId) == false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (await _db.Queryable<App_Sys_UserModel>().AnyAsync(x => x.wechatId == UserModel.wechatId && x.IsDeleted == 0&&x.audit!=1)) |
|
|
|
if (await _db.Queryable<App_Sys_UserModel>().AnyAsync(x => x.wechatId == UserModel.wechatId && x.IsDeleted == 0 && x.audit != 1)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.Message = "当前微信已与其他账号绑定"; |
|
|
|
ret.Message = "当前微信已与其他账号绑定"; |
|
|
@ -556,7 +556,7 @@ namespace _24Hour.Controllers |
|
|
|
[Route("cardIdLogin")] |
|
|
|
[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(); |
|
|
|
var date = await _db.Queryable<App_Sys_UserModel>().Where(q => q.IsDeleted == 0 && q.cardId == cardId && q.name == name).FirstAsync(); |
|
|
|
if (date != null) |
|
|
|
if (date != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//if (date.usertype == 1 && date.audit == null) |
|
|
|
//if (date.usertype == 1 && date.audit == null) |
|
|
@ -572,7 +572,7 @@ namespace _24Hour.Controllers |
|
|
|
// return ret; |
|
|
|
// return ret; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// else |
|
|
|
// else |
|
|
|
if (date.usertype == 0 && date.becurrent == 1) |
|
|
|
if (date.usertype == 0 && date.becurrent == 1 && date.isdeactivate==1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.Message = $"用户未授权无法登录,请联系管理员!"; |
|
|
|
ret.Message = $"用户未授权无法登录,请联系管理员!"; |
|
|
@ -616,22 +616,33 @@ namespace _24Hour.Controllers |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
var UserModel = new App_Sys_UserModel(); |
|
|
|
var datea = await _db.Queryable<App_Sys_UserModel>().Where(q => q.IsDeleted == 0 && q.cardId == cardId).FirstAsync(); |
|
|
|
_db.BeginTran(); |
|
|
|
if (datea==null) |
|
|
|
UserModel.Id = Guid.NewGuid().ToString(); |
|
|
|
{ |
|
|
|
UserModel.cardId = cardId; |
|
|
|
var UserModel = new App_Sys_UserModel(); |
|
|
|
UserModel.name = name; |
|
|
|
_db.BeginTran(); |
|
|
|
UserModel.usertype = 1; |
|
|
|
UserModel.Id = Guid.NewGuid().ToString(); |
|
|
|
string cardIdpwa = UserModel.cardId.Substring(UserModel.cardId.Length - 6); |
|
|
|
UserModel.cardId = cardId; |
|
|
|
//默认密码身份证后六位 |
|
|
|
UserModel.name = name; |
|
|
|
UserModel.Password = Elight.Utility.Encrypt.Md5.Encrypt32($"{cardIdpwa}").ToLower(); |
|
|
|
UserModel.usertype = 1; |
|
|
|
var num = await _db.Insertable(UserModel).ExecuteCommandAsync(); |
|
|
|
string cardIdpwa = UserModel.cardId.Substring(UserModel.cardId.Length - 6); |
|
|
|
_db.CommitTran(); |
|
|
|
//默认密码身份证后六位 |
|
|
|
if (num > 0) |
|
|
|
UserModel.Password = Elight.Utility.Encrypt.Md5.Encrypt32($"{cardIdpwa}").ToLower(); |
|
|
|
|
|
|
|
var num = await _db.Insertable(UserModel).ExecuteCommandAsync(); |
|
|
|
|
|
|
|
_db.CommitTran(); |
|
|
|
|
|
|
|
if (num > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ret.IsSucceed = true; |
|
|
|
|
|
|
|
ret.result = "添加成功"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
ret.IsSucceed = true; |
|
|
|
ret.IsSucceed = false; |
|
|
|
ret.result = "添加成功"; |
|
|
|
ret.Message = $"用户未授权无法登录,请联系管理员!"; |
|
|
|
|
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|