租户端登录限制admin账号登录

usertest
cjy 3 months ago
parent da87e104b0
commit e4b6cc61d6

@ -375,12 +375,17 @@ public class CommonService : ICommonService
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<string>> ClientUserLogin(UserLoginModel model) public async Task<DataResult<string>> ClientUserLogin(UserLoginModel model)
{ {
if (model.UserName.ToLower().Trim() == "admin")
{
return await Task.FromResult(DataResult<string>.Failed("非租户端用户!"));
}
var userInfo = await db.Queryable<SysUser>().Filter(null, true) var userInfo = await db.Queryable<SysUser>().Filter(null, true)
.FirstAsync(x => x.UserCode == model.UserName && x.IsUseSystem == true); .FirstAsync(x => x.UserCode == model.UserName && x.IsUseSystem == true);
if (userInfo == null) if (userInfo == null)
{ {
return await Task.FromResult(DataResult<string>.Failed("账号不存在或账号禁用,请检查!")); return await Task.FromResult(DataResult<string>.Failed("账号不存在或账号禁用,请检查!"));
} }
if (userInfo.MD5Password != model.Password) if (userInfo.MD5Password != model.Password)
{ {

Loading…
Cancel
Save