Skip to content

Commit

Permalink
fix isues #19: 合并为单个类库
Browse files Browse the repository at this point in the history
  • Loading branch information
ixre committed Feb 15, 2020
1 parent b0cf42b commit 8d2ac21
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 211 deletions.
32 changes: 0 additions & 32 deletions src/app/JR.Cms.WebUI/JR.Cms.WebUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -692,42 +692,10 @@
<Content Include="Global.asax" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Cache\JR.Cms.CacheService\JR.Cms.CacheService.csproj">
<Project>{d40b1fb7-00f9-4d07-b034-eb51ab99e447}</Project>
<Name>JR.Cms.CacheService</Name>
</ProjectReference>
<ProjectReference Include="..\..\core\JR.Cms.Core\JR.Cms.Core.csproj">
<Project>{c3841a42-df60-43bb-bc3c-03185cf0216d}</Project>
<Name>JR.Cms.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\core\JR.Cms.Infrastructure\JR.Cms.Infrastructure.csproj">
<Project>{28221385-8873-45f3-afd6-611dfd041bec}</Project>
<Name>JR.Cms.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\core\JR.Cms.Web\JR.Cms.WebImpl.csproj">
<Project>{940d0f3b-b28a-4759-b9ae-3c54aac4036d}</Project>
<Name>JR.Cms.WebImpl</Name>
</ProjectReference>
<ProjectReference Include="..\..\dba\JR.Cms.BLL\JR.Cms.BLL.csproj">
<Project>{39bcb411-39ca-4635-9c9b-f9fbae40058e}</Project>
<Name>JR.Cms.BLL</Name>
</ProjectReference>
<ProjectReference Include="..\..\Domain\JR.Cms.Domain.Interface\JR.Cms.Domain.Interface.csproj">
<Project>{DB45CA62-9B89-4ABE-9ED2-54B45175D37B}</Project>
<Name>JR.Cms.Domain.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\..\Service\JR.Cms.DataTransfer\JR.Cms.DataTransfer.csproj">
<Project>{a925a0e7-22d6-4da7-8b75-87aa0d6d6e24}</Project>
<Name>JR.Cms.DataTransfer</Name>
</ProjectReference>
<ProjectReference Include="..\..\Service\JR.Cms.ServiceContract\JR.Cms.ServiceContract.csproj">
<Project>{f512899c-b4c9-465f-a3db-8e511c92a8a8}</Project>
<Name>JR.Cms.ServiceContract</Name>
</ProjectReference>
<ProjectReference Include="..\..\Service\JR.Cms.Service\JR.Cms.Service.csproj">
<Project>{477203f2-8a7f-4cea-b17e-21f8b35a8b22}</Project>
<Name>JR.Cms.Service</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="oem\root\" />
Expand Down
2 changes: 1 addition & 1 deletion src/app/JR.Cms.WebUI/_Boot/CmsEventRegister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

using System.Linq;
using JR.Cms.CacheService;
using JR.Cms.Conf;
using JR.Cms.Library.CacheService;
using JR.Cms.WebImpl.Resource;

namespace JR.Cms
Expand Down
29 changes: 14 additions & 15 deletions src/core/JR.Cms.Core/Cms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
using JR.Cms.Conf;
using JR.Cms.Core;
using JR.Cms.Core.Plugins;
using JR.Cms.Infrastructure;
using JR.Cms.DataTransfer;
using JR.DevFw.PluginKernel;
using JR.DevFw.Framework.Web.UI;
using JR.Cms.DB;
using JR.Cms.Infrastructure;
using JR.Cms.Library.CacheProvider;
using JR.Cms.Library.CacheProvider.CacheCompoment;
using JR.Cms.ServiceDto;
using JR.DevFw.Framework.IO;
using SiteDto = JR.Cms.ServiceDto.SiteDto;
using JR.DevFw.Framework.Web.UI;
using JR.DevFw.PluginKernel;

namespace JR.Cms
{
Expand Down Expand Up @@ -272,13 +271,13 @@ public static void Init(BootFlag flag, String confPath)
//检查网站激活状态
//SoftwareActivator.VerifyActivation();
//如果不存在模板文件夹,则创建目录
if (!Directory.Exists(Cms.PyhicPath + "templates/"))
if (!Directory.Exists(PyhicPath + "templates/"))
{
Directory.CreateDirectory(Cms.PyhicPath + "templates/").Create();
Directory.CreateDirectory(PyhicPath + "templates/").Create();
//暂时网络安装默认模板(后可使用资源代替)
Updater.InstallTemplate("default", "tpl_default.zip");
}
_templateManager = new TemplateManager(Cms.PyhicPath + CmsVariables.TEMPLATE_PATH);
_templateManager = new TemplateManager(PyhicPath + CmsVariables.TEMPLATE_PATH);

// 注册模板
Template.Register("/" + CmsVariables.TEMPLATE_PATH, true);
Expand All @@ -288,7 +287,7 @@ public static void Init(BootFlag flag, String confPath)
PluginConfig.PLUGIN_TMP_DIRECTORY = CmsVariables.TEMP_PATH + "plugin/";
PluginConfig.PLUGIN_LOG_OPENED = true;
PluginConfig.PLUGIN_LOG_EXCEPT_FORMAT = "** {time} **:{message}\r\nSource:{source}\r\nAddress:{addr}\r\nStack:{stack}\r\n\r\n";
string pluginPhysicPath = Cms.PyhicPath + PluginConfig.PLUGIN_TMP_DIRECTORY;
string pluginPhysicPath = PyhicPath + PluginConfig.PLUGIN_TMP_DIRECTORY;
if (!Directory.Exists(pluginPhysicPath))
{
Directory.CreateDirectory(pluginPhysicPath).Create();
Expand All @@ -297,11 +296,11 @@ public static void Init(BootFlag flag, String confPath)
CmsPluginContext.Connect();

// 设置验证码字体
VerifyCodeGenerator.SetFontFamily(Cms.PyhicPath + CmsVariables.FRAMEWORK_ASSETS_PATH + "fonts/comic.ttf");
VerifyCodeGenerator.SetFontFamily(PyhicPath + CmsVariables.FRAMEWORK_ASSETS_PATH + "fonts/comic.ttf");
}
if (OnInit != null)
{
Cms.OnInit();
OnInit();
}

IsInitFinish = true;
Expand All @@ -315,7 +314,7 @@ private static void CopyOEMToRoot(string dir)
{
try
{
IOUtils.CopyFolder(Cms.PyhicPath + "/" + CmsVariables.OEM_PATH + dir, Cms.PyhicPath);
IOUtils.CopyFolder(PyhicPath + "/" + CmsVariables.OEM_PATH + dir, PyhicPath);
}
catch (Exception ex)
{
Expand All @@ -326,7 +325,7 @@ private static void CopyOEMToRoot(string dir)
private static void InitKvDb()
{
//注册KvDB
string kvDir = Cms.PyhicPath + CmsVariables.TEMP_PATH + "data/gcp";
string kvDir = PyhicPath + CmsVariables.TEMP_PATH + "data/gcp";
if (Directory.Exists(kvDir))
{
try
Expand Down Expand Up @@ -386,7 +385,7 @@ private static void LoadOtherConfig()
/// <param name="sites"></param>
public static void RegSites(SiteDto[] sites)
{
Cms._sites = sites;
_sites = sites;
}


Expand All @@ -410,7 +409,7 @@ private static void ChkCreate(string path)

private static void resetTempFiles()
{
DirectoryInfo dir = new DirectoryInfo(Cms.PyhicPath + CmsVariables.TEMP_PATH);
DirectoryInfo dir = new DirectoryInfo(PyhicPath + CmsVariables.TEMP_PATH);
if (dir.Exists)
{
foreach (FileInfo file in dir.GetFiles())
Expand Down
4 changes: 1 addition & 3 deletions src/core/JR.Cms.Core/Core/Interface/ICmsPageGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
*
*/

using JR.Cms.DataTransfer;
using ArchiveDto = JR.Cms.ServiceDto.ArchiveDto;
using CategoryDto = JR.Cms.ServiceDto.CategoryDto;
using JR.Cms.ServiceDto;

namespace JR.Cms.Core.Interface
{
Expand Down
36 changes: 0 additions & 36 deletions src/core/JR.Cms.Core/Infrastructure/Properties/AssemblyInfo.cs

This file was deleted.

Binary file removed src/core/JR.Cms.Core/Infrastructure/x86/leveldb.dll
Binary file not shown.
11 changes: 0 additions & 11 deletions src/core/JR.Cms.Core/JR.Cms.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@
<Compile Include="Infrastructure\KV\MicroKvStorage.cs" />
<Compile Include="Infrastructure\KV\Platform.cs" />
<Compile Include="Infrastructure\OperateResult.cs" />
<Compile Include="Infrastructure\Properties\AssemblyInfo.cs" />
<Compile Include="Infrastructure\ResourceMap.cs" />
<Compile Include="Infrastructure\Resources\CmsResource.Designer.cs" />
<Compile Include="Infrastructure\Tree\TreeNode.cs" />
Expand Down Expand Up @@ -430,13 +429,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="Infrastructure\Kvdb_leveldb.cs.bak" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.csproj.CopyComplete" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.csproj.FileListAbsolute.txt" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.csproj.GenerateResource.cache" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.csprojAssemblyReference.cache" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.dll" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.pdb" />
<Content Include="Infrastructure\obj\Debug\JR.Cms.Infrastructure.Resources.CmsResource.resources" />
<Content Include="Infrastructure\Resources\xml\lang_package.xml" />
<Content Include="WebImpl\Export\ExcelExportProvider.cs_" />
<Content Include="WebImpl\Resource\SiteResouce\assets\animate.css" />
Expand Down Expand Up @@ -485,9 +477,6 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="Infrastructure\obj\Debug\TempPE" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Infrastructure\Resources\CmsResource.resx" />
<EmbeddedResource Include="WebImpl\Resource\SiteResource.resx">
Expand Down
1 change: 0 additions & 1 deletion src/core/JR.Cms.Core/WebImpl/PageGenerateObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Web;
using JR.Cms.Core;
using JR.Cms.Core.Interface;
using JR.Cms.DataTransfer;
using JR.Cms.Domain.Interface.Common.Language;
using JR.Cms.Domain.Interface.Enum;
using JR.Cms.Domain.Interface.Models;
Expand Down
3 changes: 1 addition & 2 deletions src/core/JR.Cms.Core/WebImpl/WebManager/BasePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
using System.Text.RegularExpressions;
using System.Web;
using JR.Cms.Conf;
using JR.Cms.DataTransfer;
using JR.Cms.ServiceDto;
using JR.Cms.WebImpl.Json;
using JR.DevFw;
using JR.DevFw.Framework.Extensions;
using SiteDto = JR.Cms.ServiceDto.SiteDto;

namespace JR.Cms.WebImpl.WebManager
{
Expand Down
10 changes: 4 additions & 6 deletions src/core/JR.Cms.Core/WebImpl/WebManager/CmsWebMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
using System.Web;
using JR.Cms.CacheService;
using JR.Cms.Conf;
using JR.Cms.DataTransfer;
using JR.Cms.Library.CacheService;
using JR.Cms.Library.Utility;
using JR.Cms.ServiceDto;
using JR.DevFw.Web;
using SiteDto = JR.Cms.ServiceDto.SiteDto;
using UserDto = JR.Cms.ServiceDto.UserDto;

namespace JR.Cms.WebImpl.WebManager
{
Expand Down Expand Up @@ -88,7 +86,7 @@ private static SiteDto GetSiteFromCookie(HttpContext context, SiteDto site)

public static void SetCurrentManageSite(HttpContext context, SiteDto value)
{
HttpCookie cookie = context.Request.Cookies.Get(CmsWebMaster.CookieNameKey);
HttpCookie cookie = context.Request.Cookies.Get(CookieNameKey);
if (cookie != null)
{
if (value.SiteId <= 0)
Expand All @@ -106,15 +104,15 @@ public static void SetCurrentManageSite(HttpContext context, SiteDto value)
}
else
{
cookie = new HttpCookie(CmsWebMaster.CookieNameKey, value.SiteId.ToString())
cookie = new HttpCookie(CookieNameKey, value.SiteId.ToString())
{
Expires = DateTime.Now.AddDays(2),
Path = "/" + Settings.SYS_ADMIN_TAG
};
context.Response.Cookies.Add(cookie);
}

context.Session[CmsWebMaster.CurrentSiteSessionStr] = null;
context.Session[CurrentSiteSessionStr] = null;
}
}
}
23 changes: 10 additions & 13 deletions src/core/JR.Cms.Core/WebImpl/WebManager/Handle/AjaxC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,23 @@
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using System.Xml;
using JR.Cms.CacheService;
using JR.Cms.Conf;
using JR.Cms.DataTransfer;
using JR.Cms.Domain.Interface.Models;
using JR.Cms.Infrastructure.Tree;
using JR.Cms.Library.CacheProvider;
using JR.Cms.Library.DataAccess.BLL;
using JR.Cms.Library.Utility;
using JR.Cms.ServiceDto;
using JR.Cms.WebImpl.Json;
using JR.DevFw.Framework.Text;
using static JR.Cms.Updater;
using ArchiveDto = JR.Cms.ServiceDto.ArchiveDto;
using CategoryDto = JR.Cms.ServiceDto.CategoryDto;
using SiteDto = JR.Cms.ServiceDto.SiteDto;
using UserDto = JR.Cms.ServiceDto.UserDto;

namespace JR.Cms.WebImpl.WebManager.Handle
{
Expand Down Expand Up @@ -180,7 +177,7 @@ private static string GetMenuJsonFromFile(bool isMaster, int siteId)

//读取配置
string setfile = String.Format("{0}config/sysset.conf", AppDomain.CurrentDomain.BaseDirectory);
if (global::System.IO.File.Exists(setfile))
if (File.Exists(setfile))
{
xd.Load(setfile);
}
Expand Down Expand Up @@ -319,7 +316,7 @@ public void CheckUpgrade_GET()

string message = "未知异常";

VersionInfo result = Updater.CheckUpgrade();
VersionInfo result = CheckUpgrade();

switch (result.FetchCode)
{
Expand Down Expand Up @@ -350,7 +347,7 @@ public void GetUpgrade_POST()
{
if (Cms.OfficialEnvironment)
{
Updater.StartUpgrade();
StartUpgrade();
}
}

Expand All @@ -359,19 +356,19 @@ public void GetUpgrade_POST()
/// </summary>
public void GetUpgradeStatus_GET()
{
float f = Updater.UpgradePercent;
float f = UpgradePercent;
base.Response.Write(f.ToString(CultureInfo.InvariantCulture));

if (f == 1F)
{
Updater.ApplyBinFolder();
ApplyBinFolder();
}
else if (f < 1F)
{
Updater.UpgradePercent += (float)new Random().Next(1, 3) / 100;
if (Updater.UpgradePercent > 0.96F)
UpgradePercent += (float)new Random().Next(1, 3) / 100;
if (UpgradePercent > 0.96F)
{
Updater.UpgradePercent = 0.96F;
UpgradePercent = 0.96F;
}
}
}
Expand Down
Loading

0 comments on commit 8d2ac21

Please sign in to comment.