diff --git a/.issuetracker b/.issuetracker
index 8b53996c..bd80eb91 100644
--- a/.issuetracker
+++ b/.issuetracker
@@ -3,7 +3,7 @@
# (note that '\' need to be escaped).
[issuetracker "Gitee-Issue"]
- regex = "#((?!.*Issue|issue|Comme|comme).{5})"
+ regex = "#((?!.*Issue|issue|Comme|comme)[A-Za-z0-9]+)"
url = "https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues/$1?from=project-issue"
[issuetracker "Gitee-Url"]
diff --git a/BootstrapAdmin.sln b/BootstrapAdmin.sln
index 11a99198..637d32d9 100644
--- a/BootstrapAdmin.sln
+++ b/BootstrapAdmin.sln
@@ -5,14 +5,14 @@ VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLServer", "SQLServer", "{87319AF5-7C40-4362-B67C-35F9DD737DB4}"
ProjectSection(SolutionItems) = preProject
- scripts\SqlServer\InitData.sql = scripts\SqlServer\InitData.sql
- scripts\SqlServer\install.ps1 = scripts\SqlServer\install.ps1
- scripts\SqlServer\Install.sql = scripts\SqlServer\Install.sql
+ db\SqlServer\InitData.sql = db\SqlServer\InitData.sql
+ db\SqlServer\install.ps1 = db\SqlServer\install.ps1
+ db\SqlServer\Install.sql = db\SqlServer\Install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Admin", "src\admin\Bootstrap.Admin\Bootstrap.Admin.csproj", "{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{586410F2-C1F0-47CD-AB28-2CF506DED2C8}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "db", "db", "{586410F2-C1F0-47CD-AB28-2CF506DED2C8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client", "src\client\Bootstrap.Client\Bootstrap.Client.csproj", "{C82A6E45-AB90-43D1-8429-5CBE953D8151}"
EndProject
@@ -22,37 +22,37 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess", "src
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLite", "SQLite", "{523515EC-2AD7-4282-9AF4-9D20371183B0}"
ProjectSection(SolutionItems) = preProject
- scripts\SQLite\InitData.sql = scripts\SQLite\InitData.sql
- scripts\SQLite\Install.sql = scripts\SQLite\Install.sql
+ db\SQLite\InitData.sql = db\SQLite\InitData.sql
+ db\SQLite\Install.sql = db\SQLite\Install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess.MongoDB", "src\admin\Bootstrap.DataAccess.MongoDB\Bootstrap.DataAccess.MongoDB.csproj", "{8336F096-4B4A-4710-A1FA-0F5E44CD8D26}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MongoDB", "MongoDB", "{A06A0AD8-A246-4329-B024-7174AE4A3EDE}"
ProjectSection(SolutionItems) = preProject
- scripts\MongoDB\Dicts.js = scripts\MongoDB\Dicts.js
- scripts\MongoDB\Groups.js = scripts\MongoDB\Groups.js
- scripts\MongoDB\init.js = scripts\MongoDB\init.js
- scripts\MongoDB\install.sh = scripts\MongoDB\install.sh
- scripts\MongoDB\Navigations.js = scripts\MongoDB\Navigations.js
- scripts\MongoDB\Roles.js = scripts\MongoDB\Roles.js
- scripts\MongoDB\Users.js = scripts\MongoDB\Users.js
+ db\MongoDB\Dicts.js = db\MongoDB\Dicts.js
+ db\MongoDB\Groups.js = db\MongoDB\Groups.js
+ db\MongoDB\init.js = db\MongoDB\init.js
+ db\MongoDB\install.sh = db\MongoDB\install.sh
+ db\MongoDB\Navigations.js = db\MongoDB\Navigations.js
+ db\MongoDB\Roles.js = db\MongoDB\Roles.js
+ db\MongoDB\Users.js = db\MongoDB\Users.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MySQL", "MySQL", "{084E2E94-6B7D-4D3E-9BF1-6972427FBF80}"
ProjectSection(SolutionItems) = preProject
- scripts\MySQL\initData.sql = scripts\MySQL\initData.sql
- scripts\MySQL\install.sh = scripts\MySQL\install.sh
- scripts\MySQL\install.sql = scripts\MySQL\install.sql
- scripts\MySQL\my.ini = scripts\MySQL\my.ini
+ db\MySQL\initData.sql = db\MySQL\initData.sql
+ db\MySQL\install.sh = db\MySQL\install.sh
+ db\MySQL\install.sql = db\MySQL\install.sql
+ db\MySQL\my.ini = db\MySQL\my.ini
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\UnitTest\UnitTest.csproj", "{CFE75C48-F9D5-403A-8419-D07939BBD769}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Postgresql", "Postgresql", "{6F61C2AC-84D4-48A9-8A48-680657CC8175}"
ProjectSection(SolutionItems) = preProject
- scripts\Postgresql\initData.sql = scripts\Postgresql\initData.sql
- scripts\Postgresql\install.sql = scripts\Postgresql\install.sql
+ db\Postgresql\initData.sql = db\Postgresql\initData.sql
+ db\Postgresql\install.sql = db\Postgresql\install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess", "src\client\Bootstrap.Client.DataAccess\Bootstrap.Client.DataAccess.csproj", "{843811A2-FE49-410F-BF9F-9F1FB14A1DEE}"
@@ -84,6 +84,31 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{85574E
src\admin\Bootstrap.Admin\Linux.Dockerfile = src\admin\Bootstrap.Admin\Linux.Dockerfile
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "srcipts", "srcipts", "{72C103DB-E1D3-449F-97C2-DF12CA111FD4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "win", "win", "{C6F2DCA0-7941-4C28-9328-2D495F5DCB00}"
+ ProjectSection(SolutionItems) = preProject
+ publish-admin.cmd = publish-admin.cmd
+ publish-client.cmd = publish-client.cmd
+ watch-run-admin.cmd = watch-run-admin.cmd
+ watch-run-client.cmd = watch-run-client.cmd
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "linux", "linux", "{FDCFC3E3-14CF-40B2-9FE5-5BC239AAC110}"
+ ProjectSection(SolutionItems) = preProject
+ publish-admin.sh = publish-admin.sh
+ publish-client.sh = publish-client.sh
+ watch-run-admin.sh = watch-run-admin.sh
+ watch-run-client.sh = watch-run-client.sh
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ci", "ci", "{5F732D4E-133B-4DA6-811B-C369CDC3FB89}"
+ ProjectSection(SolutionItems) = preProject
+ appveyor.build.ps1 = appveyor.build.ps1
+ appveyor.test.ps1 = appveyor.test.ps1
+ appveyor.yml = appveyor.yml
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -137,6 +162,9 @@ Global
{843811A2-FE49-410F-BF9F-9F1FB14A1DEE} = {C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}
{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5} = {C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}
{E03B7391-B52F-4449-B400-5CD9DE01F085} = {41B6D37A-5E5E-42B3-85E4-D81A81E3D757}
+ {C6F2DCA0-7941-4C28-9328-2D495F5DCB00} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4}
+ {FDCFC3E3-14CF-40B2-9FE5-5BC239AAC110} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4}
+ {5F732D4E-133B-4DA6-811B-C369CDC3FB89} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {221EAE38-5F75-4391-9A48-E462A9F3B8FC}
diff --git a/Directory.Build.props b/Directory.Build.props
index 9df49bac..448d547f 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -12,6 +12,14 @@
true
+
+
+
+
+
+
+
+
diff --git a/appveyor.build.ps1 b/appveyor.build.ps1
index 6e054495..d291b044 100644
--- a/appveyor.build.ps1
+++ b/appveyor.build.ps1
@@ -4,12 +4,3 @@
}
runCmd "dotnet build src\admin\Bootstrap.Admin"
runCmd "dotnet publish src\admin\Bootstrap.Admin --configuration Release --no-restore"
-
-$publishFolder = "$($env:appveyor_build_folder)\src\admin\Bootstrap.Admin\bin\Release\netcoreapp2.2\publish"
-$licFile = "$($env:appveyor_build_folder)\src\admin\keys\Longbow.lic"
-write-host "copy file $licFile" -ForegroundColor Cyan
-xcopy $licFile $publishFolder /y
-
-$dbFile = "$($env:appveyor_build_folder)\src\admin\Bootstrap.Admin\BootstrapAdmin.db"
-write-host "copy file $dbFile" -ForegroundColor Cyan
-xcopy $dbFile $publishFolder /y
\ No newline at end of file
diff --git a/appveyor.test.ps1 b/appveyor.test.ps1
index 3460bb9f..db415d0d 100644
--- a/appveyor.test.ps1
+++ b/appveyor.test.ps1
@@ -1,6 +1,6 @@
function installDB() {
write-host "init sqlserver database..." -ForegroundColor Cyan
- $startPath = "$($env:appveyor_build_folder)\scripts\SqlServer"
+ $startPath = "$($env:appveyor_build_folder)\db\SqlServer"
$sqlInstance = "(local)\SQL2014"
$outFile = join-path $startPath "output.log"
$sqlFile = join-path $startPath "Install.sql"
@@ -14,7 +14,7 @@
$cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot'
cmd.exe /c $cmd
- $startPath = "$($env:appveyor_build_folder)\scripts\MySQL"
+ $startPath = "$($env:appveyor_build_folder)\db\MySQL"
$para = ' -hlocalhost -uroot -DBootstrapAdmin < '
$sqlFile = join-path $startPath "Install.sql"
$cmd = $mysql + $para + $sqlFile
@@ -25,7 +25,7 @@
cmd.exe /c $cmd
write-host "init mongodb data..." -ForegroundColor Cyan
- $initFolder = "$($env:appveyor_build_folder)\scripts\MongoDB"
+ $initFolder = "$($env:appveyor_build_folder)\db\MongoDB"
cd $initFolder
cmd.exe /c "C:\mongodb\bin\mongo init.js"
diff --git a/appveyor.yml b/appveyor.yml
index 8ff3909a..60b317a3 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -27,7 +27,7 @@ install:
dotnet --version
- xcopy "$($env:appveyor_build_folder)\scripts\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y
+ xcopy "$($env:appveyor_build_folder)\db\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y
build_script:
- ps: >-
.\appveyor.build.ps1
diff --git a/scripts/MongoDB/Dicts.js b/db/MongoDB/Dicts.js
similarity index 91%
rename from scripts/MongoDB/Dicts.js
rename to db/MongoDB/Dicts.js
index 94d2d0e8..ccf9f6b2 100644
--- a/scripts/MongoDB/Dicts.js
+++ b/db/MongoDB/Dicts.js
@@ -257,5 +257,29 @@
"Name": "卡片标题状态",
"Code": "1",
"Define": NumberInt(0)
+ },
+ {
+ "Category": "网站设置",
+ "Name": "短信验证码登录",
+ "Code": "1",
+ "Define": NumberInt(0)
+ },
+ {
+ "Category": "网站设置",
+ "Name": "OAuth 认证登录",
+ "Code": "1",
+ "Define": NumberInt(0)
+ },
+ {
+ "Category": "网站设置",
+ "Name": "自动锁屏时长",
+ "Code": "30",
+ "Define": NumberInt(0)
+ },
+ {
+ "Category": "网站设置",
+ "Name": "自动锁屏",
+ "Code": "0",
+ "Define": NumberInt(0)
}
];
\ No newline at end of file
diff --git a/scripts/MongoDB/Groups.js b/db/MongoDB/Groups.js
similarity index 100%
rename from scripts/MongoDB/Groups.js
rename to db/MongoDB/Groups.js
diff --git a/scripts/MongoDB/Navigations.js b/db/MongoDB/Navigations.js
similarity index 95%
rename from scripts/MongoDB/Navigations.js
rename to db/MongoDB/Navigations.js
index dae95468..e23ab85a 100644
--- a/scripts/MongoDB/Navigations.js
+++ b/db/MongoDB/Navigations.js
@@ -191,6 +191,30 @@
"IsResource": NumberInt(2),
"Application": "0"
},
+ {
+ "_id": ObjectId("5bd7b8445fa31256f77e4b06"),
+ "ParentId": "5bd7b8445fa31256f77e4b93",
+ "Name": "登录设置",
+ "Order": NumberInt(60),
+ "Icon": "fa fa-fa",
+ "Url": "loginSettings",
+ "Category": "0",
+ "Target": "_self",
+ "IsResource": NumberInt(2),
+ "Application": "0"
+ },
+ {
+ "_id": ObjectId("5bd7b8445fa31256f77e4b07"),
+ "ParentId": "5bd7b8445fa31256f77e4b93",
+ "Name": "自动锁屏",
+ "Order": NumberInt(70),
+ "Icon": "fa fa-fa",
+ "Url": "lockScreen",
+ "Category": "0",
+ "Target": "_self",
+ "IsResource": NumberInt(2),
+ "Application": "0"
+ },
{
"_id": ObjectId("5bd7b8445fa31256f77e4b94"),
"ParentId": "0",
@@ -635,6 +659,18 @@
"IsResource": NumberInt(0),
"Application": "0"
},
+ {
+ "_id": ObjectId("5bd9b3d868aa001661776f60"),
+ "ParentId": "5bd7b8445fa31256f77e4b9c",
+ "Name": "SQL日志",
+ "Order": NumberInt(40),
+ "Icon": "fa fa-database",
+ "Url": "~/Admin/SQL",
+ "Category": "0",
+ "Target": "_self",
+ "IsResource": NumberInt(0),
+ "Application": "0"
+ },
{
"_id": ObjectId("5bd7b8445fa31256f77e4b89"),
"ParentId": "0",
diff --git a/scripts/MongoDB/Roles.js b/db/MongoDB/Roles.js
similarity index 100%
rename from scripts/MongoDB/Roles.js
rename to db/MongoDB/Roles.js
diff --git a/scripts/MongoDB/Users.js b/db/MongoDB/Users.js
similarity index 100%
rename from scripts/MongoDB/Users.js
rename to db/MongoDB/Users.js
diff --git a/scripts/MongoDB/init.js b/db/MongoDB/init.js
similarity index 100%
rename from scripts/MongoDB/init.js
rename to db/MongoDB/init.js
diff --git a/scripts/MongoDB/install.sh b/db/MongoDB/install.sh
similarity index 100%
rename from scripts/MongoDB/install.sh
rename to db/MongoDB/install.sh
diff --git a/scripts/MySQL/initData.sql b/db/MySQL/initData.sql
similarity index 94%
rename from scripts/MySQL/initData.sql
rename to db/MySQL/initData.sql
index e9b87b0b..32e693a6 100644
--- a/scripts/MySQL/initData.sql
+++ b/db/MySQL/initData.sql
@@ -33,6 +33,14 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '前台
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '侧边栏状态', '1', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '卡片标题状态', '1', 0);
+-- 登录配置
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '短信验证码登录', '1', 0);
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'OAuth 认证登录', '1', 0);
+
+-- 自动锁屏(秒)默认 30 秒
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动锁屏时长', '30', 0);
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动锁屏', '0', 0);
+
-- 时长单位 月
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '程序异常保留时长', '1', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '操作日志保留时长', '12', 0);
@@ -67,6 +75,8 @@ INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResourc
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 4, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
+INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 5, '登录设置', 60, 'fa fa-fa', 'loginSettings', '0', 2);
+INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 6, '自动锁屏', 70, 'fa fa-fa', 'lockScreen', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
@@ -104,6 +114,7 @@ INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 1, '登录日志', 20, 'fa fa-user-circle-o', '~/Admin/Logins', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 2, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
+INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 3, 'SQL日志', 40, 'fa fa-database', '~/Admin/SQL', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '网站分析', 145, 'fa fa-line-chart', '~/Admin/Analyse', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
diff --git a/scripts/MySQL/install.sh b/db/MySQL/install.sh
similarity index 100%
rename from scripts/MySQL/install.sh
rename to db/MySQL/install.sh
diff --git a/scripts/MySQL/install.sql b/db/MySQL/install.sql
similarity index 95%
rename from scripts/MySQL/install.sql
rename to db/MySQL/install.sql
index 38076517..750a711d 100644
--- a/scripts/MySQL/install.sql
+++ b/db/MySQL/install.sql
@@ -182,4 +182,11 @@ CREATE TABLE Traces(
City VARCHAR (50),
RequestUrl VARCHAR (500) NOT NULL,
UserAgent VARCHAR (2000) NULL
-);
\ No newline at end of file
+);
+
+CREATE TABLE DBLogs (
+ ID INTEGER PRIMARY KEY Auto_increment,
+ UserName VARCHAR (50) NULL,
+ `SQL` VARCHAR (2000) NOT NULL,
+ LogTime DATETIME NOT NULL
+);
diff --git a/scripts/MySQL/my.ini b/db/MySQL/my.ini
similarity index 100%
rename from scripts/MySQL/my.ini
rename to db/MySQL/my.ini
diff --git a/scripts/Postgresql/initData.sql b/db/Postgresql/initData.sql
similarity index 94%
rename from scripts/Postgresql/initData.sql
rename to db/Postgresql/initData.sql
index 8a36ebb3..2762c29c 100644
--- a/scripts/Postgresql/initData.sql
+++ b/db/Postgresql/initData.sql
@@ -33,6 +33,14 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '前台
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '侧边栏状态', '1', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '卡片标题状态', '1', 0);
+-- 登录配置
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '短信验证码登录', '1', 0);
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'OAuth 认证登录', '1', 0);
+
+-- 自动锁屏(秒)默认 30 秒
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动锁屏时长', '30', 0);
+INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动锁屏', '0', 0);
+
-- 时长单位 月
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '程序异常保留时长', '1', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '操作日志保留时长', '12', 0);
@@ -67,6 +75,9 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 5, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 6, '登录设置', 60, 'fa fa-fa', 'loginSettings', '0', 2);
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 7, '自动锁屏', 70, 'fa fa-fa', 'lockScreen', '0', 2);
+
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
@@ -104,6 +115,7 @@ INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 1, 0, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 2, 0, '登录日志', 20, 'fa fa-user-circle-o', '~/Admin/Logins', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 3, 0, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
+INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 4, 0, 'SQL日志', 40, 'fa fa-database', '~/Admin/SQL', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '网站分析', 145, 'fa fa-line-chart', '~/Admin/Analyse', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
diff --git a/scripts/Postgresql/install.ps1 b/db/Postgresql/install.ps1
similarity index 100%
rename from scripts/Postgresql/install.ps1
rename to db/Postgresql/install.ps1
diff --git a/scripts/Postgresql/install.sql b/db/Postgresql/install.sql
similarity index 96%
rename from scripts/Postgresql/install.sql
rename to db/Postgresql/install.sql
index f7779581..981c0b3b 100644
--- a/scripts/Postgresql/install.sql
+++ b/db/Postgresql/install.sql
@@ -182,4 +182,11 @@ CREATE TABLE Traces(
City VARCHAR (50),
RequestUrl VARCHAR (500) NOT NULL,
UserAgent VARCHAR (2000) NULL
-);
\ No newline at end of file
+);
+
+CREATE TABLE DBLogs (
+ ID SERIAL PRIMARY KEY,
+ UserName VARCHAR (50) NULL,
+ SQL VARCHAR (2000) NOT NULL,
+ LogTime DATE NOT NULL
+);
diff --git a/scripts/SQLite/InitData.sql b/db/SQLite/InitData.sql
similarity index 94%
rename from scripts/SQLite/InitData.sql
rename to db/SQLite/InitData.sql
index 375f16b1..5aedae78 100644
--- a/scripts/SQLite/InitData.sql
+++ b/db/SQLite/InitData.sql
@@ -33,6 +33,14 @@ INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '侧边栏状态', '1', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '卡片标题状态', '1', 0);
+-- 登录配置
+INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '短信验证码登录', '1', 0);
+INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', 'OAuth 认证登录', '1', 0);
+
+-- 自动锁屏(秒)默认 30 秒
+INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '自动锁屏时长', '30', 0);
+INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '自动锁屏', '0', 0);
+
-- 时长单位 月
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', '程序异常保留时长', '1', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', '操作日志保留时长', '12', 0);
@@ -67,6 +75,8 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 4, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 5, '登录设置', 60, 'fa fa-fa', 'loginSettings', '0', 2);
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 6, '自动锁屏', 70, 'fa fa-fa', 'lockScreen', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
@@ -104,6 +114,7 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid(), '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 1, '登录日志', 20, 'fa fa-user-circle-o', '~/Admin/Logins', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 2, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 3, 'SQL日志', 40, 'fa fa-database', '~/Admin/SQL', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '网站分析', 145, 'fa fa-line-chart', '~/Admin/Analyse', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
diff --git a/scripts/SQLite/Install.sql b/db/SQLite/Install.sql
similarity index 96%
rename from scripts/SQLite/Install.sql
rename to db/SQLite/Install.sql
index ce3fe3a8..cae22b42 100644
--- a/scripts/SQLite/Install.sql
+++ b/db/SQLite/Install.sql
@@ -182,4 +182,11 @@ CREATE TABLE Traces(
City VARCHAR (50),
RequestUrl VARCHAR (500) NOT NULL,
UserAgent VARCHAR (2000)
+);
+
+CREATE TABLE DBLogs (
+ ID INTEGER PRIMARY KEY,
+ UserName VARCHAR (50) COLLATE NOCASE,
+ SQL VARCHAR NOT NULL,
+ LogTime DATETIME NOT NULL
);
\ No newline at end of file
diff --git a/scripts/SqlServer/InitData.sql b/db/SqlServer/InitData.sql
similarity index 94%
rename from scripts/SqlServer/InitData.sql
rename to db/SqlServer/InitData.sql
index 24cc56c4..9f92aa78 100644
--- a/scripts/SqlServer/InitData.sql
+++ b/db/SqlServer/InitData.sql
@@ -36,6 +36,14 @@ INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'侧边栏状态', N'1', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'卡片标题状态', N'1', 0)
+-- 登录配置
+INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'短信验证码登录', N'1', 0)
+INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'OAuth 认证登录', N'1', 0)
+
+-- 自动锁屏(秒)默认 30 秒
+INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'自动锁屏时长', N'30', 0)
+INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'自动锁屏', N'0', 0)
+
-- 时长单位 月
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'程序异常保留时长', '1', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'操作日志保留时长', '12', 0)
@@ -70,6 +78,8 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 4, N'清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 5, N'登录设置', 60, 'fa fa-fa', 'loginSettings', '0', 2);
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 6, N'自动锁屏', 70, 'fa fa-fa', 'lockScreen', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'菜单管理', 50, N'fa fa-dashboard', N'~/Admin/Menus', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'编辑', 20, 'fa fa-fa', 'edit', '0', 2);
@@ -107,6 +117,7 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity, N'操作日志', 10, N'fa fa-edit', N'~/Admin/Logs', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 1, N'登录日志', 20, N'fa fa-user-circle-o', N'~/Admin/Logins', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 2, N'访问日志', 30, N'fa fa-bars', N'~/Admin/Traces', N'0')
+INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 3, N'SQL日志', 40, N'fa fa-database', N'~/Admin/SQL', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'在线用户', 140, N'fa fa-users', N'~/Admin/Online', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'网站分析', 145, N'fa fa-line-chart', N'~/Admin/Analyse', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'程序异常', 150, N'fa fa-cubes', N'~/Admin/Exceptions', N'0')
diff --git a/scripts/SqlServer/Install.sql b/db/SqlServer/Install.sql
similarity index 97%
rename from scripts/SqlServer/Install.sql
rename to db/SqlServer/Install.sql
index f2d5f0ba..981a3d90 100644
--- a/scripts/SqlServer/Install.sql
+++ b/db/SqlServer/Install.sql
@@ -577,4 +577,30 @@ CREATE TABLE [dbo].[Traces](
GO
SET ANSI_PADDING OFF
-GO
\ No newline at end of file
+GO
+
+/****** Object: Table [dbo].[DBLogs] Script Date: 09/22/2019 22:06:43 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+SET ANSI_PADDING ON
+GO
+
+CREATE TABLE [dbo].[DBLogs](
+ [ID] [int] IDENTITY(1,1) NOT NULL,
+ [UserName] [varchar](50) NULL,
+ [SQL] [nvarchar](max) NOT NULL,
+ [LogTime] [datetime] NOT NULL,
+ CONSTRAINT [PK_DBLogs] 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
+
+SET ANSI_PADDING OFF
+GO
diff --git a/scripts/SqlServer/install.ps1 b/db/SqlServer/install.ps1
similarity index 100%
rename from scripts/SqlServer/install.ps1
rename to db/SqlServer/install.ps1
diff --git a/publish-admin.cmd b/publish-admin.cmd
new file mode 100644
index 00000000..f22cb3ed
--- /dev/null
+++ b/publish-admin.cmd
@@ -0,0 +1,3 @@
+@echo off
+
+dotnet publish src\admin\Bootstrap.Admin -c Release
diff --git a/publish-client.cmd b/publish-client.cmd
new file mode 100644
index 00000000..2d3b5113
--- /dev/null
+++ b/publish-client.cmd
@@ -0,0 +1,3 @@
+@echo off
+
+dotnet publish src\client\Bootstrap.Client -c Release
diff --git a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj
index 82b380c2..e8d36643 100644
--- a/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj
+++ b/src/admin/Bootstrap.Admin/Bootstrap.Admin.csproj
@@ -11,12 +11,11 @@
-
+
-
diff --git a/src/admin/Bootstrap.Admin/BootstrapAdmin.db b/src/admin/Bootstrap.Admin/BootstrapAdmin.db
index 92361faf..764248e7 100644
Binary files a/src/admin/Bootstrap.Admin/BootstrapAdmin.db and b/src/admin/Bootstrap.Admin/BootstrapAdmin.db differ
diff --git a/src/admin/Bootstrap.Admin/Controllers/AdminController.cs b/src/admin/Bootstrap.Admin/Controllers/AdminController.cs
index 9d009c90..cfb9bc5a 100644
--- a/src/admin/Bootstrap.Admin/Controllers/AdminController.cs
+++ b/src/admin/Bootstrap.Admin/Controllers/AdminController.cs
@@ -53,6 +53,12 @@ namespace Bootstrap.Admin.Controllers
///
public ActionResult Logs() => View(new NavigatorBarModel(this));
+ ///
+ ///
+ ///
+ ///
+ public ActionResult SQL() => View(new NavigatorBarModel(this));
+
///
///
///
@@ -89,7 +95,7 @@ namespace Bootstrap.Admin.Controllers
///
///
///
- public ActionResult Settings() => View(new ThemeModel(this));
+ public ActionResult Settings() => View(new SettingsModel(this));
///
///
diff --git a/src/admin/Bootstrap.Admin/Controllers/Api/LoginController.cs b/src/admin/Bootstrap.Admin/Controllers/Api/LoginController.cs
index 59562a0d..07148ca2 100644
--- a/src/admin/Bootstrap.Admin/Controllers/Api/LoginController.cs
+++ b/src/admin/Bootstrap.Admin/Controllers/Api/LoginController.cs
@@ -1,6 +1,6 @@
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
-using Bootstrap.Security;
+using Bootstrap.Security.Authentication;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
diff --git a/src/admin/Bootstrap.Admin/Controllers/Api/SQLController.cs b/src/admin/Bootstrap.Admin/Controllers/Api/SQLController.cs
new file mode 100644
index 00000000..90842cdb
--- /dev/null
+++ b/src/admin/Bootstrap.Admin/Controllers/Api/SQLController.cs
@@ -0,0 +1,26 @@
+using Bootstrap.Admin.Query;
+using Bootstrap.DataAccess;
+using Longbow.Web.Mvc;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Bootstrap.Admin.Controllers.Api
+{
+ ///
+ /// SQL 语句执行日志 webapi
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class SQLController : ControllerBase
+ {
+ ///
+ /// 获取执行日志数据
+ ///
+ ///
+ ///
+ [HttpGet]
+ public QueryData Get([FromQuery]QuerySQLOption value)
+ {
+ return value.RetrieveData();
+ }
+ }
+}
diff --git a/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs b/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs
index ebcb5d58..20889596 100644
--- a/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs
+++ b/src/admin/Bootstrap.Admin/HealthChecks/HealthChecksBuilderExtensions.cs
@@ -1,4 +1,5 @@
using Bootstrap.Admin.HealthChecks;
+using Microsoft.Extensions.Configuration;
namespace Microsoft.Extensions.DependencyInjection
{
@@ -17,7 +18,10 @@ namespace Microsoft.Extensions.DependencyInjection
var builder = services.AddHealthChecks();
builder.AddCheck("db");
builder.AddBootstrapAdminHealthChecks();
- builder.AddCheck("Gitee");
+
+ var config = services.BuildServiceProvider().GetRequiredService();
+ var checkGitee = config.GetValue("GiteeHealthChecks", false);
+ if (checkGitee) builder.AddCheck("Gitee");
return services;
}
}
diff --git a/src/admin/Bootstrap.Admin/Models/ModelBase.cs b/src/admin/Bootstrap.Admin/Models/ModelBase.cs
index 5e68a614..cb445d5f 100644
--- a/src/admin/Bootstrap.Admin/Models/ModelBase.cs
+++ b/src/admin/Bootstrap.Admin/Models/ModelBase.cs
@@ -18,6 +18,12 @@ namespace Bootstrap.Admin.Models
IsDemo = DictHelper.RetrieveSystemModel();
ShowCardTitle = DictHelper.RetrieveCardTitleStatus() ? "" : "no-card-header";
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "collapsed";
+ AllowMobile = DictHelper.RetrieveMobileLogin();
+ AllowOAuth = DictHelper.RetrieveOAuthLogin();
+ ShowMobile = AllowMobile ? "" : "mobile";
+ ShowOAuth = AllowOAuth ? "" : "oauth";
+ LockScreenPeriod = DictHelper.RetrieveAutoLockScreenPeriod();
+ EnableAutoLockScreen = DictHelper.RetrieveAutoLockScreen();
}
///
@@ -49,5 +55,35 @@ namespace Bootstrap.Admin.Models
/// 是否收缩侧边栏
///
public string ShowSideBar { get; protected set; }
+
+ ///
+ /// 获得 是否允许短信验证码登录
+ ///
+ public bool AllowMobile { get; }
+
+ ///
+ /// 获得 是否允许第三方 OAuth 认证登录
+ ///
+ public bool AllowOAuth { get; }
+
+ ///
+ /// 获得 是否允许短信验证码登录
+ ///
+ public string ShowMobile { get; }
+
+ ///
+ /// 获得 是否允许第三方 OAuth 认证登录
+ ///
+ public string ShowOAuth { get; }
+
+ ///
+ /// 获得 自动锁屏时长 默认 1 分钟 字典表中配置
+ ///
+ public int LockScreenPeriod { get; }
+
+ ///
+ /// 获得 自动锁屏功能是否自动开启 默认关闭
+ ///
+ public bool EnableAutoLockScreen { get; }
}
}
diff --git a/src/admin/Bootstrap.Admin/Models/ProfilesModel.cs b/src/admin/Bootstrap.Admin/Models/ProfilesModel.cs
index 4470c3e5..42d7d8a6 100644
--- a/src/admin/Bootstrap.Admin/Models/ProfilesModel.cs
+++ b/src/admin/Bootstrap.Admin/Models/ProfilesModel.cs
@@ -8,7 +8,7 @@ namespace Bootstrap.Admin.Models
///
///
///
- public class ProfilesModel : ThemeModel
+ public class ProfilesModel : SettingsModel
{
///
/// 获得 头像文件大小
diff --git a/src/admin/Bootstrap.Admin/Models/ThemeModel.cs b/src/admin/Bootstrap.Admin/Models/SettingsModel.cs
similarity index 59%
rename from src/admin/Bootstrap.Admin/Models/ThemeModel.cs
rename to src/admin/Bootstrap.Admin/Models/SettingsModel.cs
index 1171fc58..8d685ffc 100644
--- a/src/admin/Bootstrap.Admin/Models/ThemeModel.cs
+++ b/src/admin/Bootstrap.Admin/Models/SettingsModel.cs
@@ -6,21 +6,28 @@ using System.Collections.Generic;
namespace Bootstrap.Admin.Models
{
///
- ///
+ /// 网站设置 Model 实体类
///
- public class ThemeModel : NavigatorBarModel
+ public class SettingsModel : NavigatorBarModel
{
///
///
///
///
- public ThemeModel(ControllerBase controller) : base(controller)
+ public SettingsModel(ControllerBase controller) : base(controller)
{
Themes = DictHelper.RetrieveThemes();
+ AutoLockScreen = EnableAutoLockScreen ? "" : "lockScreen";
}
+
///
/// 获得 系统配置的所有样式表
///
public IEnumerable Themes { get; }
+
+ ///
+ /// 获得 是否开启自动锁屏
+ ///
+ public string AutoLockScreen { get; }
}
}
diff --git a/src/admin/Bootstrap.Admin/Query/QuerySQLOption.cs b/src/admin/Bootstrap.Admin/Query/QuerySQLOption.cs
new file mode 100644
index 00000000..01bbf00f
--- /dev/null
+++ b/src/admin/Bootstrap.Admin/Query/QuerySQLOption.cs
@@ -0,0 +1,40 @@
+using Bootstrap.DataAccess;
+using Longbow.Web.Mvc;
+using System;
+
+namespace Bootstrap.Admin.Query
+{
+ ///
+ /// SQL执行查询配置类
+ ///
+ public class QuerySQLOption : PaginationOption
+ {
+ ///
+ /// 获得/设置 用户登录名
+ ///
+ public string UserName { get; set; }
+
+ ///
+ /// 获得/设置 开始时间
+ ///
+ public DateTime? OperateTimeStart { get; set; }
+
+ ///
+ /// 获得/设置 结束时间
+ ///
+ public DateTime? OperateTimeEnd { get; set; }
+
+ ///
+ /// 查询数据方法
+ ///
+ ///
+ public QueryData RetrieveData()
+ {
+ var data = LogHelper.RetrieveDBLogs(this, OperateTimeStart, OperateTimeEnd, UserName);
+ var ret = new QueryData();
+ ret.total = data.TotalItems;
+ ret.rows = data.Items;
+ return ret;
+ }
+ }
+}
diff --git a/src/admin/Bootstrap.Admin/Startup.cs b/src/admin/Bootstrap.Admin/Startup.cs
index f4c94aa5..27953d84 100644
--- a/src/admin/Bootstrap.Admin/Startup.cs
+++ b/src/admin/Bootstrap.Admin/Startup.cs
@@ -1,6 +1,7 @@
using Bootstrap.DataAccess;
using Longbow.Web;
using Longbow.Web.SignalR;
+using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@@ -60,7 +61,8 @@ namespace Bootstrap.Admin
services.AddSignalR().AddJsonProtocalDefault();
services.AddSignalRExceptionFilterHandler((client, ex) => client.SendMessageBody(ex).ConfigureAwait(false));
services.AddResponseCompression();
- services.AddBootstrapAdminAuthentication().AddGitee(OAuthHelper.Configure).AddGitHub(OAuthHelper.Configure).AddWeChat(WeChatHelper.Configure);
+ // 兼容 QQ 浏览器兼容模式
+ services.AddBootstrapAdminAuthentication(configureCookies: ConfigureCookie).AddGitee(OAuthHelper.Configure).AddGitHub(OAuthHelper.Configure);
services.AddSwagger();
services.AddButtonAuthorization(MenuHelper.AuthorizateButtons);
services.AddBootstrapAdminBackgroundTask();
@@ -109,7 +111,8 @@ namespace Bootstrap.Admin
app.UseHttpsRedirection();
app.UseResponseCompression();
app.UseStaticFiles();
- app.UseBootstrapAdminAuthentication(RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
+ app.UseAuthentication();
+ app.UseBootstrapAdminAuthorization(RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
app.UseBootstrapHealthChecks();
app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save);
app.UseCacheManager();
@@ -119,12 +122,13 @@ namespace Bootstrap.Admin
routes.MapHub("/TaskLogHub");
});
app.UseSwagger(Configuration["SwaggerPathBase"].TrimEnd('/'));
- app.UseMvc(routes =>
- {
- routes.MapRoute(
- name: "default",
- template: "{controller=Home}/{action=Index}/{id?}");
- });
+ app.UseMvcWithDefaultRoute();
+ }
+
+ private void ConfigureCookie(CookieAuthenticationOptions options)
+ {
+ var supportQQ = Configuration.GetValue("SupportQQBrowser", false);
+ if (supportQQ) options.Cookie.SameSite = SameSiteMode.None;
}
}
}
diff --git a/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs b/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs
index 53cc1a66..e6151237 100644
--- a/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs
+++ b/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs
@@ -1,9 +1,10 @@
-using Longbow.Tasks;
+using Bootstrap.DataAccess;
+using Longbow.Tasks;
using Microsoft.Extensions.Hosting;
using System;
using System.Linq;
using System.Threading;
-using System.Threading.Tasks;
+using Task = System.Threading.Tasks.Task;
namespace Microsoft.Extensions.DependencyInjection
{
@@ -49,6 +50,9 @@ namespace Microsoft.Extensions.DependencyInjection
// 创建任务并禁用
TaskServicesManager.GetOrAdd("禁用任务", token => Task.Delay(1000)).Status = SchedulerStatus.Disabled;
+
+ // 真实任务负责批次写入数据执行脚本到日志中
+ TaskServicesManager.GetOrAdd("SQL日志", TriggerBuilder.Build(Cron.Minutely()));
});
}
}
diff --git a/src/admin/Bootstrap.Admin/Views/Account/Login.cshtml b/src/admin/Bootstrap.Admin/Views/Account/Login.cshtml
index 225df077..ed626aae 100644
--- a/src/admin/Bootstrap.Admin/Views/Account/Login.cshtml
+++ b/src/admin/Bootstrap.Admin/Views/Account/Login.cshtml
@@ -43,7 +43,7 @@
}
-