|
@@ -112,5 +112,37 @@ namespace Services
|
|
|
SystemFiles.Add(summary.Key);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 生成APP配置文件
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="parm">请求参数</param>
|
|
|
+ /// <returns>生成APP配置文件</returns>
|
|
|
+ public string makeAppInitData(string kind)
|
|
|
+ {
|
|
|
+ OssConfigs ossConfigs = new();
|
|
|
+ AppSettings.Bind("OssConfigs", ossConfigs);
|
|
|
+ string GotoPages = "{";
|
|
|
+ string PageInfoList = "{";
|
|
|
+ string LibFile = "{";
|
|
|
+ List<PageUpdateInfo> newpages = GetList(m => m.kind == kind).OrderBy(m => m.id).ToList();
|
|
|
+ foreach (PageUpdateInfo page in newpages)
|
|
|
+ {
|
|
|
+ string FileName = page.modulePath.Split('.')[0];
|
|
|
+ PageInfoList += "\"page" + FileName + "\":" + Newtonsoft.Json.JsonConvert.SerializeObject(page) + ",";
|
|
|
+ string PagePath = "template/app/" + kind + "/" + page.modulePath;
|
|
|
+ string pageContent = Function.GetNetFileContent(ossConfigs.Host + PagePath);
|
|
|
+ pageContent = Dbconn.Encrypt3DES(pageContent, "*ga34|^7");
|
|
|
+ LibFile += "\"page" + FileName + "\":\"" + pageContent + "\",";
|
|
|
+ }
|
|
|
+ PageInfoList = PageInfoList.TrimEnd(',');
|
|
|
+ PageInfoList += "}";
|
|
|
+ GotoPages = GotoPages.TrimEnd(',');
|
|
|
+ GotoPages += "}";
|
|
|
+ LibFile = LibFile.TrimEnd(',');
|
|
|
+ LibFile += "}";
|
|
|
+ return Dbconn.Encrypt3DES(PageInfoList, "*ga34|^7") + "#cut#" + GotoPages + "#cut#" + Dbconn.Encrypt3DES(LibFile, "*ga34|^7");
|
|
|
+ }
|
|
|
}
|
|
|
}
|