修改授权方式为手机号码和验证码方式

测试出的问题修复
This commit is contained in:
范露尧
2023-07-12 16:11:42 +08:00
parent fbbabeb690
commit 589b8a0132
86 changed files with 365 additions and 120 deletions

View File

@@ -156,8 +156,8 @@ namespace Ewide.Core.Service
// 判断用户名和密码是否正确
var user = await _sysUserRep.FirstOrDefaultAsync(u => (u.Account.Equals(input.Account) || u.Phone.Equals(input.Account) || u.Email.Equals(input.Account)) && u.Password.Equals(encryptPasswod));
_ = user ?? throw Oops.Oh(ErrorCode.D1000);
#endif
#endif
_ = user ?? throw Oops.Oh(ErrorCode.D1000);
// 验证账号是否被冻结
if (user.Status == CommonStatus.DISABLE)
throw Oops.Oh(ErrorCode.D1017);
@@ -176,6 +176,7 @@ namespace Ewide.Core.Service
{ ClaimConst.CLAINM_ACCOUNT, user.Account },
{ ClaimConst.CLAINM_NAME, user.Name },
{ ClaimConst.CLAINM_SUPERADMIN, user.AdminType },
{ ClaimConst.ExpireTime,DateTime.Now.AddHours(2)},
});
// 设置Swagger自动登录

View File

@@ -117,10 +117,10 @@ namespace Ewide.Core.Service
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public Task<bool> DelAsync(string key)
public async Task<bool> DelAsync(string key)
{
_cache.DelAsync(key);
return Task.FromResult(true);
await _cache.DelAsync(key);
return true;
}
/// <summary>
@@ -128,10 +128,10 @@ namespace Ewide.Core.Service
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public Task<bool> DelByPatternAsync(string key)
public async Task<bool> DelByPatternAsync(string key)
{
_cache.DelByPatternAsync(key);
return Task.FromResult(true);
await _cache.DelByPatternAsync(key);
return true;
}
/// <summary>

View File

@@ -141,7 +141,7 @@ namespace Ewide.Core.Service
codeGenConfig.EffectType = DataTypeToEff(codeGenConfig.NetType);
codeGenConfig.QueryType = "=="; // QueryTypeEnum.eq.ToString();
codeGenConfig.InsertAsync();
codeGenConfig.Insert();
}
}

View File

@@ -209,7 +209,7 @@ namespace Ewide.Core.Service.CodeGen
var menuType0 = new SysMenu
{
Pid = emptyGuid,
Pids = "["+ emptyGuid + "],",
Pids = "[" + emptyGuid + "],",
Name = busName + "管理",
Code = "dilon_" + className.ToLower(),
Type = 1,
@@ -236,7 +236,7 @@ namespace Ewide.Core.Service.CodeGen
var pid1 = _sysMenuRep.InsertNowAsync(menuType1).GetAwaiter().GetResult().Entity.Id;
// 按钮-page
var menuType2 = new SysMenu
var menuType2 = await new SysMenu
{
Pid = pid1,
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
@@ -248,7 +248,7 @@ namespace Ewide.Core.Service.CodeGen
}.InsertAsync();
// 按钮-detail
var menuType2_1 = new SysMenu
var menuType2_1 = await new SysMenu
{
Pid = pid1,
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
@@ -260,7 +260,7 @@ namespace Ewide.Core.Service.CodeGen
}.InsertAsync();
// 按钮-add
var menuType2_2 = new SysMenu
var menuType2_2 = await new SysMenu
{
Pid = pid1,
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
@@ -272,7 +272,7 @@ namespace Ewide.Core.Service.CodeGen
}.InsertAsync();
// 按钮-delete
var menuType2_3 = new SysMenu
var menuType2_3 = await new SysMenu
{
Pid = pid1,
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
@@ -284,7 +284,7 @@ namespace Ewide.Core.Service.CodeGen
}.InsertAsync();
// 按钮-edit
var menuType2_4 = new SysMenu
var menuType2_4 = await new SysMenu
{
Pid = pid1,
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",