2 Komitmen 8a0cb5e9c5 ... c0bae2f854

Pembuat SHA1 Pesan Tanggal
  arthur.wu c0bae2f854 Merge branch 'master' of http://git.ius.plus/Project-Wing/WingCloudServer 1 tahun lalu
  arthur.wu 2e736721fc add login result for deploy system, add translate for my 1 tahun lalu

+ 1 - 1
Tools/Flyinsono.Deployment/lib/MainScreen.dart

@@ -122,7 +122,7 @@ class _MainScreenState extends State<MainScreen> with RestorationMixin {
                         Icons.account_circle_rounded,
                       ),
                       label: Text(
-                        "My",
+                        AppLocalizations.of(context)!.my,
                       ),
                     ),
                   ],

+ 1 - 1
Tools/Flyinsono.Deployment/lib/MyView.dart

@@ -38,7 +38,7 @@ class _MyViewState extends State<MyView> {
                     backgroundColor: Colors.greenAccent[400],
                     radius: 40,
                     child: Text(
-                      'Not Login',
+                      localizations.notLogin,
                       textAlign: TextAlign.center,
                       style: TextStyle(fontSize: 20, color: Colors.white),
                     ), //Text

+ 3 - 4
Tools/Flyinsono.Deployment/lib/l10n/app_en.arb

@@ -69,7 +69,6 @@
   "ip": "server address",
   "remoteDeployIp":"remote deploy server address",
   "remoteDeployIpHintText":"private IP address will be automatically retrieved and filled in",
-  "serverID": "server ID",
   "selectVersion":"Select a version to deploy",
   "confirm":"confirm",
   "confirmStopServer":"Are you sure you want to remotely stop this server?",
@@ -113,8 +112,7 @@
   "zh":"Chinese",
   "en":"English",
   "upgrade":"upgradeSetting",
-  "getwayPort":"getway Port",
-  "remoteDeployIp":"remote deploy server port",
+  "getwayPort":"getway Port",  
   "deploySuccess": "Deployment successful",
   "deployFail": "Deployment failed",
   "nginxPath": "Nginx installation path",
@@ -123,5 +121,6 @@
   "adminBackendPort": "Admin backend port",
   "deployClient": "Deploy web version client",
   "clientPort": "Web version client port",
-  "save":"save"
+  "save":"save",
+  "notLogin":"Not Login"
 }

+ 4 - 5
Tools/Flyinsono.Deployment/lib/l10n/app_zh.arb

@@ -4,7 +4,7 @@
   "package": "打包",
   "publish": "发布",
   "autoTest": "测试",
-  "my": "杏聆荟部署系统",
+  "my": "我的",
   "create": "创建",
   "operatorList":"用户",
   "createTime": "创建时间",
@@ -69,7 +69,6 @@
   "ip":"服务器地址",
   "remoteDeployIp":"远程服务地址",
   "remoteDeployIpHintText":"内网IP地址将自动获取并填写",
-  "serverID":"服务器ID",
   "selectVersion":"选择一个版本",
   "confirm":"确认",
   "confirmStopServer":"确定要远程关闭服务吗?",
@@ -113,8 +112,7 @@
   "zh":"中文",
   "en":"英文",
   "upgrade":"检查更新配置",
-  "getwayPort":"网关端口",
-  "remoteDeployIp":"远程服务端口",
+  "getwayPort":"网关端口", 
   "deploySuccess":"部署成功",
   "deployFail":"部署失败",
   "nginxPath":"nginx安装路径",
@@ -123,5 +121,6 @@
   "adminBackendPort":"管理后台端口",
   "deployClient":"部署web版客户端",
   "clientPort":"web版客户端端口",
-  "save":"保存"
+  "save":"保存",
+  "notLogin":"未登录"
 }

+ 19 - 13
src/WingDeployPlatformService/DeployPlatformService.cs

@@ -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>