Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne committed May 27, 2019
2 parents 7e7909a + 2c0222f commit d45bbc5
Show file tree
Hide file tree
Showing 80 changed files with 355 additions and 159 deletions.
10 changes: 7 additions & 3 deletions DataBase/Build-With-Empty-Site.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ exit
@echo Working directory:%cd%
set /P server=1.Sql Server address (local):
if "%server%"=="" set server=(local)
set /P dataBase=2.Database name (ZKEACMS_Core):
if "%dataBase%"=="" set dataBase=ZKEACMS_Core
set /P dataBase=2.Database name (ZKEACMS):
if "%dataBase%"=="" set dataBase=ZKEACMS
set /P dbUserId=3.User name (sa):
if "%dbUserId%"=="" set dbUserId=sa
set /P dbPassword=4.Password (sa):
if "%dbPassword%"=="" set dbPassword=sa

@echo Please wait...
@echo Creating DataBase %dataBase%
set dbname='%dataBase%'
sqlcmd -S %server% -d master -U %dbUserId% -P %dbPassword% -b -i "CreateDataBase.sql"
if %ERRORLEVEL% NEQ 0 goto errors

Expand Down Expand Up @@ -69,6 +68,11 @@ if %ERRORLEVEL% NEQ 0 goto errors
@echo ArticleDetailWidget
sqlcmd -x -S %server% -d %dataBase% -U %dbUserId% -P %dbPassword% -b -i "Tables\dbo.ArticleDetailWidget.Table.sql"
if %ERRORLEVEL% NEQ 0 goto errors

@echo ArticleSpecialDetailWidget
sqlcmd -x -S %server% -d %dataBase% -U %dbUserId% -P %dbPassword% -b -i "Tables\dbo.ArticleSpecialDetailWidget.Table.sql"
if %ERRORLEVEL% NEQ 0 goto errors

@echo ArticleListWidget
sqlcmd -x -S %server% -d %dataBase% -U %dbUserId% -P %dbPassword% -b -i "Tables\dbo.ArticleListWidget.Table.sql"
if %ERRORLEVEL% NEQ 0 goto errors
Expand Down
5 changes: 2 additions & 3 deletions DataBase/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ exit
@echo Working directory:%cd%
set /P server=1.Sql Server address (local):
if "%server%"=="" set server=(local)
set /P dataBase=2.Database name (ZKEACMS_Core):
if "%dataBase%"=="" set dataBase=ZKEACMS_Core
set /P dataBase=2.Database name (ZKEACMS):
if "%dataBase%"=="" set dataBase=ZKEACMS
set /P dbUserId=3.User name (sa):
if "%dbUserId%"=="" set dbUserId=sa
set /P dbPassword=4.Password (sa):
if "%dbPassword%"=="" set dbPassword=sa

@echo Please wait...
@echo Creating DataBase %dataBase%
set dbname='%dataBase%'
sqlcmd -S %server% -d master -U %dbUserId% -P %dbPassword% -b -i "CreateDataBase.sql"
if %ERRORLEVEL% NEQ 0 goto errors

Expand Down
2 changes: 1 addition & 1 deletion DataBase/Build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

server='localhost'
dataBase='ZKEACMS_Core'
dataBase='ZKEACMS'
dbUserId='sa'
dbPassword='sa'

Expand Down
4 changes: 2 additions & 2 deletions DataBase/Export.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ REM:https://github.com/microsoft/mssql-scripter/blob/dev/doc/usage_guide.md
@echo Working directory:%cd%
set /P server=1.Sql Server address (local):
if "%server%"=="" set server=(local)
set /P dataBase=2.Database name (ZKEACMS_Core):
if "%dataBase%"=="" set dataBase=ZKEACMS_Core
set /P dataBase=2.Database name (ZKEACMS):
if "%dataBase%"=="" set dataBase=ZKEACMS
set /P dbUserId=3.User name (sa):
if "%dbUserId%"=="" set dbUserId=sa
set /P dbPassword=4.Password (sa):
Expand Down
2 changes: 1 addition & 1 deletion DataBase/Export.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
server='localhost'
database='ZKEACMS_Core'
database='ZKEACMS'
username='sa'
password='sa'

Expand Down
4 changes: 2 additions & 2 deletions DataBase/MySql/Dump.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE DATABASE IF NOT EXISTS `ZKEACMS_Core` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ZKEACMS_Core`;
CREATE DATABASE IF NOT EXISTS `ZKEACMS` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ZKEACMS`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: ZKEACMS_Core
Expand Down
2 changes: 1 addition & 1 deletion DataBase/SQLite/Export.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
@pause


Export2SQLCE.exe "Data Source=(local);Initial Catalog=ZKEACMS_Core;Integrated Security=True" ZKEACMS.sqlite.sql sqlite
Export2SQLCE.exe "Data Source=(local);Initial Catalog=ZKEACMS;Integrated Security=True" ZKEACMS.sqlite.sql sqlite
19 changes: 19 additions & 0 deletions DataBase/Tables/dbo.ArticleSpecialDetailWidget.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ArticleSpecialDetailWidget](
[ID] [nvarchar](100) NOT NULL,
[ArticleId] [int] NULL,
[ArticleName] [nvarchar](100) NULL,
CONSTRAINT [PK_ArticleSpecialDetailWidget] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


28 changes: 14 additions & 14 deletions DataBase/Update/3.1.7/Scripts.sql
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
update Language set LanValue=N'英文名' where LanKey=N'ArticleEntity@Url' and CultureName=N'zh-CN'
update Language set LanValue=N'英文名' where LanKey=N'ArticleType@Url' and CultureName=N'zh-CN'
update Language set LanValue=N'英文名' where LanKey=N'ProductCategory@Url' and CultureName=N'zh-CN'
update Language set LanValue=N'英文名' where LanKey=N'ProductEntity@Url' and CultureName=N'zh-CN'
update Language set LanValue='英文名' where LanKey='ArticleEntity@Url' and CultureName='zh-CN';
update Language set LanValue='英文名' where LanKey='ArticleType@Url' and CultureName='zh-CN';
update Language set LanValue='英文名' where LanKey='ProductCategory@Url' and CultureName='zh-CN';
update Language set LanValue='英文名' where LanKey='ProductEntity@Url' and CultureName='zh-CN';

delete from [Language] where LanKey='ArticleSpecialDetailWidget@ArticleId'
delete from [Language] where LanKey='ArticleSpecialDetailWidget@ArticleName'
delete FROM [Language] where LanKey like 'TemplateFile@%'
delete from [Language] where LanKey='ArticleSpecialDetailWidget@ArticleId';
delete from [Language] where LanKey='ArticleSpecialDetailWidget@ArticleName';
delete FROM [Language] where LanKey like 'TemplateFile@%';

insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('ArticleSpecialDetailWidget@ArticleId','zh-CN','文章ID','ArticleSpecialDetailWidget','EntityProperty')
insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('ArticleSpecialDetailWidget@ArticleName','zh-CN','文章英文名','ArticleSpecialDetailWidget','EntityProperty')
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('ArticleSpecialDetailWidget@ArticleId','zh-CN','文章ID','ArticleSpecialDetailWidget','EntityProperty');
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('ArticleSpecialDetailWidget@ArticleName','zh-CN','文章英文名','ArticleSpecialDetailWidget','EntityProperty');

insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@Content','zh-CN','模板代码','TemplateFile','EntityProperty')
insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@LastUpdateTime','zh-CN','最后更新时间','TemplateFile','EntityProperty')
insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@Name','zh-CN','名称','TemplateFile','EntityProperty')
insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@RelativePath','zh-CN','模板路径','TemplateFile','EntityProperty')
insert into dbo.Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@ThemeName','zh-CN','主题','TemplateFile','EntityProperty')
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@Content','zh-CN','模板代码','TemplateFile','EntityProperty');
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@LastUpdateTime','zh-CN','最后更新时间','TemplateFile','EntityProperty');
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@Name','zh-CN','名称','TemplateFile','EntityProperty');
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@RelativePath','zh-CN','模板路径','TemplateFile','EntityProperty');
insert into Language (LanKey,CultureName,LanValue,Module,LanType) VALUES('TemplateFile@ThemeName','zh-CN','主题','TemplateFile','EntityProperty');
4 changes: 2 additions & 2 deletions DataBase/script.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
USE [master]
DROP DATABASE IF EXISTS [ZKEACMS_Core]
DROP DATABASE IF EXISTS [ZKEACMS]
GO
CREATE DATABASE [ZKEACMS_Core]
CREATE DATABASE [ZKEACMS]
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
Expand Down
46 changes: 46 additions & 0 deletions src/EasyFrameWork/Extend/ExtFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Easy.Extend
{
public static class ExtFile
{
public static bool ExistDirectory(string path)
{
return Directory.Exists(path);
}

public static bool ExistFile(string path)
{
return File.Exists(path);
}

public static string ReadFile(string path)
{
if (!ExistFile(path)) return string.Empty;

return File.ReadAllText(path, Encoding.UTF8);
}

public static string[] GetFiles(string path, string searchPattern, SearchOption opt = SearchOption.AllDirectories)
{
if (!ExistDirectory(path)) return null;
return Directory.GetFiles(path, searchPattern, opt);
}

public static void WriteFile(string path, string content, Encoding encoding = null)
{
if (encoding == null) encoding = Encoding.UTF8;
string dire = Path.GetDirectoryName(path);
if (!ExistDirectory(dire)) Directory.CreateDirectory(dire);
File.WriteAllText(path, content, encoding);
}

public static void DeleteFile(string path)
{
File.Delete(path);
}
}
}
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
}
else
{
loggerFactory.UseFileLog(env, app.ApplicationServices.GetService<IHttpContextAccessor>());
app.UseExceptionHandler("/Error");
app.UseStatusCodePagesWithReExecute("/Error/Code/{0}");
}
loggerFactory.UseFileLog(env, app.ApplicationServices.GetService<IHttpContextAccessor>());
app.UseZKEACMS(env, httpContextAccessor);
}
}
Expand Down
16 changes: 11 additions & 5 deletions src/ZKEACMS.WebHost/Views/Theme/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
<div class="thumbnail @(item.IsActived ? "active" : "")">
<a href="@Url.Action("PreView", "Theme", new {id = item.ID})">
<img src="@Url.Content(item.Thumbnail ?? ThemeEntity.DefaultThumbnail)" alt="@item.Title"/>
<img src="@Url.Content(item.Thumbnail ?? ThemeEntity.DefaultThumbnail)" alt="@item.Title" />
</a>
@if (Authorizer.Authorize(PermissionKeys.ManageTheme))
{
Expand All @@ -34,7 +34,7 @@
</div>
}
</div>
<hr/>
<hr />
<ul class="text-muted">
<li>
@L("点击主题“缩略图”可进行进行预览,在预览页面右上角点击“退出主题预览”可回到该页面")
Expand All @@ -45,15 +45,21 @@
<li>
@L("若主题有更新,重复安装即可更新")
</li>
@*<li>
<span style="color:red;">友情提示: 切换主题时,会先删除大部分数据,然后导入主题自带数据,操作不可逆,请先线下备份数据库</span><br />
<span>删除主题数据的脚本位置: /wwwroot/themes/主题名称/sql/uninstall/*.sql</span><br />
<span>导入主题数据的脚本位置: /wwwroot/themes/主题名称/sql/install/*.sql</span><br />
<span>文件夹下脚本顺序很重要,切莫调整顺序</span>
</li>*@
</ul>
</div>
@if (Authorizer.Authorize(PermissionKeys.ManageTheme))
{
<div class="panel-footer clearfix">
<input type="button" value="@L("安装主题")" class="btn btn-primary select-theme"/>
<input type="button" value="@L("安装主题")" class="btn btn-primary select-theme" />
<a target="_blank" class="btn btn-danger" href="http://www.zkea.net/zkeacms/theme">@L("下载更多主题")</a>
<div class="hide">
<input id="file" type="file" name="file"/>
<input id="file" type="file" name="file" />
</div>
</div>
}
Expand All @@ -67,7 +73,7 @@
$(this).closest(".thumbnail").addClass("active");
Easy.MessageTip.Show("@L("切换主题中...")");
$.post("@Url.Action("ChangeTheme")", { id: $(this).val() }, function (data) {
Easy.MessageTip.Show("@L("切换主题成功!")");
Easy.MessageTip.Show(data.message);
});
});
$(document).on("click", ".select-theme", function () {
Expand Down
4 changes: 2 additions & 2 deletions src/ZKEACMS.WebHost/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Database": {
"DbType": "MsSql",
"ConnectionString": "Server=(local);Database=ZKEACMS_Core;User Id=sa;Password=sa;MultipleActiveResultSets=true;"
"ConnectionString": "Server=(local);Database=ZKEACMS;User Id=sa;Password=sa;MultipleActiveResultSets=true;"
//"DbType": "Sqlite",
//"ConnectionString": "Data Source=App_Data/Database.sqlite"
//"DbType": "MySql",
Expand All @@ -21,4 +21,4 @@
"Code": "zh-CN"
//"Code": "en-US"
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d45bbc5

Please sign in to comment.