Explorar el Código

同步页面文件,更新名称

lcl hace 9 meses
padre
commit
8f1775bbd8
Se han modificado 1 ficheros con 34 adiciones y 23 borrados
  1. 34 23
      Services/PageUpdateInfoService.cs

+ 34 - 23
Services/PageUpdateInfoService.cs

@@ -70,32 +70,43 @@ namespace Services
                             if (match.Success)
                             {
                                 admintitle = match.Value.Replace("<title>", "").Replace("</title>", "");
-                                if (admintitle.Contains("-"))
-                                {
-                                    title = admintitle.Substring(admintitle.LastIndexOf("-") + 1);
-                                }
-                                else
-                                {
+                                // if (admintitle.Contains("-"))
+                                // {
+                                //     title = admintitle.Substring(admintitle.LastIndexOf("-") + 1);
+                                // }
+                                // else
+                                // {
                                     title = admintitle;
-                                }
+                                // }
+                            }
+                            var item = GetFirst(m => m.modulePath == template);
+                            if(item == null)
+                            {
+                                Add(new PageUpdateInfo()
+                                {
+                                    createDate = DateTime.Now,
+                                    updateDate = DateTime.Now,
+                                    kind = parm.kind,
+                                    leftAction1 = "{\"Url\":\"GoBack#{\\\"Level\\\":\\\"1\\\"}\",\"Jump\":\"1\",\"Kind\":\"2\"}",
+                                    leftBtn1 = "static/images/left.png",
+                                    skidFlag = true,
+                                    showScrollBar = false,
+                                    title = title,
+                                    showTitle = true,
+                                    statusBarStyle = "default",
+                                    textColor = "333333",
+                                    backgroudColor = "FFFFFF",
+                                    modulePath = template,
+                                    moduleVersion = 1,
+                                    mustUpdate = true,
+                                });
                             }
-                            Add(new PageUpdateInfo()
+                            else
                             {
-                                createDate = DateTime.Now,
-                                updateDate = DateTime.Now,
-                                kind = parm.kind,
-                                leftAction1 = "{\"Url\":\"GoBack#{\\\"Level\\\":\\\"1\\\"}\",\"Jump\":\"1\",\"Kind\":\"2\"}",
-                                leftBtn1 = "static/images/left.png",
-                                skidFlag = true,
-                                showScrollBar = false,
-                                title = title,
-                                showTitle = true,
-                                statusBarStyle = "default",
-                                textColor = "333333",
-                                backgroudColor = "FFFFFF",
-                                modulePath = template,
-                                moduleVersion = 1,
-                            });
+                                item.updateDate = DateTime.Now;
+                                item.title = title;
+                                Update(item, true);
+                            }
                         }
                     }
                 }