|
@@ -1043,7 +1043,7 @@ namespace WingDeployPlatformService
|
|
|
/// <returns></returns>
|
|
|
public async Task<IList<DeployPlatOperatorDTO>> GetOperatorListAsync()
|
|
|
{
|
|
|
- var list = _operatorDAL.ListAll();
|
|
|
+ var list = _operatorDAL.ListAll().Where(x=>x.Status == DeployPlatOperatorStatusEnum.Active);
|
|
|
var result = list.MappingTo<List<DeployPlatOperatorDTO>>();
|
|
|
return result;
|
|
|
}
|
|
@@ -1095,27 +1095,33 @@ namespace WingDeployPlatformService
|
|
|
/// 登录
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<bool> LoginAsync(OperatorLoginRequest request)
|
|
|
+ public async Task<DeployPlatLoginResultEnum> LoginAsync(OperatorLoginRequest request)
|
|
|
{
|
|
|
var name = request.Name;
|
|
|
var password = request.Password;
|
|
|
+ if (password != "123456") //TODO refactor
|
|
|
+ {
|
|
|
+ return DeployPlatLoginResultEnum.WrongPassword;
|
|
|
+ }
|
|
|
+
|
|
|
var list = _operatorDAL.ListAll();
|
|
|
- if (list != null && list.Count() > 0)
|
|
|
+ if(list == null)
|
|
|
{
|
|
|
- if (list.Select(x => x.Name).Contains(name))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return DeployPlatLoginResultEnum.Unknown;
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ var user = list.FirstOrDefault(x=>x.Name == name);
|
|
|
+ if (user == nulll)
|
|
|
{
|
|
|
- return true;
|
|
|
+ return DeployPlatLoginResultEnum.WrongAccountName;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(user.Status == DeployPlatOperatorStatusEnum.Inactive)
|
|
|
+ {
|
|
|
+ return DeployPlatLoginResultEnum.AccountInActive;
|
|
|
}
|
|
|
|
|
|
+ return DeployPlatLoginResultEnum.Ok;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|