Prechádzať zdrojové kódy

APP页面数据检查判断版本号,版本号从kind参数获取

lcl 7 mesiacov pred
rodič
commit
383fcc109b

BIN
.DS_Store


+ 26 - 1
Controllers/Client/AppController.cs

@@ -48,6 +48,13 @@ namespace Controllers
         [Route("/v1/kxsconfig/app/appBottomNavs")]
         public IActionResult AppBottomNavs([FromQuery] AppAppBottomNavsDto parm)
         {
+            string kind = Function.CheckNull(parm.kind);
+            if(kind.Contains("/"))
+            {
+                string[] data = kind.Split('/');
+                parm.kind = data[0];
+                parm.appVersion = data[1];
+            }
             var response = _AppBottomNavsService.AppBottomNavs(parm);
             response.Extra = new Dictionary<string, object>();
             response.Extra.Add("greyStyle", "");
@@ -66,6 +73,13 @@ namespace Controllers
         [Route("/v1/kxsconfig/app/staticFiles")]
         public IActionResult StaticFiles([FromQuery] AppStaticFilesDto parm)
         {
+            string kind = Function.CheckNull(parm.kind);
+            if(kind.Contains("/"))
+            {
+                string[] data = kind.Split('/');
+                parm.kind = data[0];
+                parm.appVersion = data[1];
+            }
             var response = _FileUpdateInfoService.StaticFiles(parm);
             OssConfigs ossConfigs = new();
             AppSettings.Bind("OssConfigs", ossConfigs);
@@ -89,6 +103,13 @@ namespace Controllers
         [Route("/v1/kxsconfig/app/pageInfo")]
         public IActionResult PageInfo([FromQuery] AppPageInfoDto parm)
         {
+            string kind = Function.CheckNull(parm.kind);
+            if(kind.Contains("/"))
+            {
+                string[] data = kind.Split('/');
+                parm.kind = data[0];
+                parm.appVersion = data[1];
+            }
             OssConfigs ossConfigs = new();
             AppSettings.Bind("OssConfigs", ossConfigs);
             string modulePath = parm.modulePath + ".html";
@@ -98,7 +119,11 @@ namespace Controllers
             response.dataId = Function.MD5_16(response.id.ToString() + "123890");
             if (parm.moduleVersion < response.moduleVersion)
             {
-                string PagePath = "template/app/" + parm.kind + "/" + response.modulePath;
+                if(!string.IsNullOrEmpty(parm.appVersion))
+                {
+                    kind += "/" + parm.appVersion;
+                }
+                string PagePath = "template/app/" + kind + "/" + response.modulePath;
                 string pageContent = Function.GetNetFileContent(ossConfigs.Host + PagePath);
                 response.moduleContent = pageContent; //模板内容
             }

+ 1 - 1
Services/AppBottomNavsService.cs

@@ -26,7 +26,7 @@ namespace Services
         {
             //开始拼装查询条件
             var predicate = Expressionable.Create<AppBottomNavs>();
-            predicate = predicate.And(m => m.appVersion.Contains(parm.appVersion));
+            predicate = predicate.And(m => m.appVersion == parm.appVersion);
             predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
             var response = Queryable()
                 .Where(predicate.ToExpression())

+ 1 - 1
Services/AppVersionService.cs

@@ -25,7 +25,7 @@ namespace Services
         {
             //开始拼装查询条件
             var predicate = Expressionable.Create<AppVersion>();
-            predicate = predicate.And(m => m.appVersion.Contains(parm.appVersion));
+            predicate = predicate.And(m => m.appVersion == parm.appVersion);
             predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
             var response = Queryable()
                 .Where(predicate.ToExpression())

+ 1 - 1
Services/Client/AppBottomNavsService.cs

@@ -25,7 +25,7 @@ namespace Services.Client
         {
             //开始拼装查询条件
             var predicate = Expressionable.Create<AppBottomNavs>();
-            predicate = predicate.And(m => m.appVersion.Contains(parm.appVersion));
+            predicate = predicate.And(m => m.appVersion == parm.appVersion);
             predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
             var response = Queryable()
                 .Where(predicate.ToExpression())

+ 1 - 1
Services/Client/FileUpdateInfoService.cs

@@ -27,7 +27,7 @@ namespace Services.Client
             page.pageSize = 100000;
             //开始拼装查询条件
             var predicate = Expressionable.Create<FileUpdateInfo>();
-            predicate = predicate.And(m => m.appVersion.Contains(parm.appVersion));
+            predicate = predicate.And(m => m.appVersion == parm.appVersion);
             predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
             var response = Queryable()
                 .Where(predicate.ToExpression())

+ 1 - 1
Services/FileUpdateInfoService.cs

@@ -29,7 +29,7 @@ namespace Services
         {
             //开始拼装查询条件
             var predicate = Expressionable.Create<FileUpdateInfo>();
-            predicate = predicate.And(m => m.appVersion.Contains(parm.appVersion));
+            predicate = predicate.And(m => m.appVersion == parm.appVersion);
             predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
             var response = Queryable()
                 .Where(predicate.ToExpression())

+ 4 - 0
Services/PageUpdateInfoService.cs

@@ -148,6 +148,10 @@ namespace Services
             string PageInfoList = "{";
             string LibFile = "{";
             List<PageUpdateInfo> newpages = GetList(m => m.kind == kind && m.appVersion == appVersion);
+            if(!string.IsNullOrEmpty(appVersion))
+            {
+                kind += "/" + appVersion;
+            }
             foreach (PageUpdateInfo page in newpages)
             {
                 string FileName = page.modulePath.Split('.')[0];