Compare commits

..

3 Commits

Author SHA1 Message Date
Argo Zhang 680d632efe
build: 根据最新目录结构重构脚本 2019-09-28 11:17:38 +08:00
Argo Zhang 19f8653996
build: 目录调整
#Comment
数据库脚本文件归入 db 文件夹下
脚本文件归入 scripts 文件夹下
2019-09-28 11:17:25 +08:00
Argo Zhang cca7da1472
fix(#I12T0Y): 更新配置文件默认支持QQ兼容模式
#Comment
comment #I12T0Y

#Issue
link https://gitee.com/LongbowEnterprise/dashboard/issues?id=I12T0Y
2019-09-28 08:56:43 +08:00
1367 changed files with 9161 additions and 69455 deletions

View File

@ -6,17 +6,13 @@ root=true
# All files
[*]
indent_style = space
# shell files
[*.{cmd,sh,bat}]
insert_final_newline = true
trim_trailing_whitespace = true
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8-bom
[*.{json,yml,xml,csproj,props}]
[*.{json,yml,xml}]
indent_size = 2
###############################
# .NET Coding Conventions #
@ -123,13 +119,9 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
csharp_style_namespace_declarations=file_scoped:silent
###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
[*.cs]
# Add file header
file_header_template = Copyright (c) Argo Zhang (argo@163.com). All rights reserved.\nLicensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.\nWebsite: https://admin.blazor.zone

View File

@ -14,6 +14,6 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.103
dotnet-version: 2.2.108
- name: Build with dotnet
run: dotnet build src/admin/Bootstrap.Admin/ --configuration Release

View File

@ -12,4 +12,4 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: docker build . --file src/admin/Bootstrap.Admin/Dockerfile --tag ba:$(date +%s)
run: docker build . --file src/admin/Bootstrap.Admin/Linux.Dockerfile --tag ba:$(date +%s)

5
.gitignore vendored
View File

@ -85,6 +85,7 @@ StyleCopReport.xml
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
@ -347,10 +348,10 @@ ASALocalRun/
# Net Core Keys
**/[Kk]eys/*.xml
Bootstrap*.xml
Bootstrap.Admin.xml
###### -- Custom Ignore Section, Make sure all files you add to the git repo are below this line -- ######
# Coverage
coverage*.xml
tools/
tools/

View File

@ -1,17 +0,0 @@
{
"solution": {
"path": "BootstrapAdmin.sln",
"projects": [
"src\\blazor\\admin\\BootstrapAdmin.Caching\\BootstrapAdmin.Caching.csproj",
"src\\blazor\\admin\\BootstrapAdmin.DataAccess.Models\\BootstrapAdmin.DataAccess.Models.csproj",
"src\\blazor\\admin\\BootstrapAdmin.DataAccess.PetaPoco\\BootstrapAdmin.DataAccess.PetaPoco.csproj",
"src\\blazor\\admin\\BootstrapAdmin.Web.Core\\BootstrapAdmin.Web.Core.csproj",
"src\\blazor\\admin\\BootstrapAdmin.Web\\BootstrapAdmin.Web.csproj",
"src\\blazor\\client\\BootstrapClient.DataAccess\\BootstrapClient.DataAccess.PetaPoco.csproj",
"src\\blazor\\client\\BootstrapClient.Shared\\BootstrapClient.Web.Shared.csproj",
"src\\blazor\\client\\BootstrapClient.Web.Core\\BootstrapClient.Web.Core.csproj",
"src\\blazor\\client\\BootstrapClient.Web.Models\\BootstrapClient.DataAccess.Models.csproj",
"src\\blazor\\client\\BootstrapClient.Web\\BootstrapClient.Web.csproj"
]
}
}

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
# Visual Studio Version 16
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
@ -10,15 +10,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLServer", "SQLServer", "{
db\SqlServer\Install.sql = db\SqlServer\Install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Admin", "src\mvc\admin\Bootstrap.Admin\Bootstrap.Admin.csproj", "{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A}"
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}") = "db", "db", "{586410F2-C1F0-47CD-AB28-2CF506DED2C8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client", "src\mvc\client\Bootstrap.Client\Bootstrap.Client.csproj", "{C82A6E45-AB90-43D1-8429-5CBE953D8151}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client", "src\client\Bootstrap.Client\Bootstrap.Client.csproj", "{C82A6E45-AB90-43D1-8429-5CBE953D8151}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess", "src\mvc\admin\Bootstrap.DataAccess\Bootstrap.DataAccess.csproj", "{8D62BE79-BE13-43C8-969B-C9B00B3C84B7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess", "src\admin\Bootstrap.DataAccess\Bootstrap.DataAccess.csproj", "{8D62BE79-BE13-43C8-969B-C9B00B3C84B7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLite", "SQLite", "{523515EC-2AD7-4282-9AF4-9D20371183B0}"
ProjectSection(SolutionItems) = preProject
@ -26,14 +26,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLite", "SQLite", "{523515
db\SQLite\Install.sql = db\SQLite\Install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess.MongoDB", "src\mvc\admin\Bootstrap.DataAccess.MongoDB\Bootstrap.DataAccess.MongoDB.csproj", "{8336F096-4B4A-4710-A1FA-0F5E44CD8D26}"
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
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.ps1 = db\MongoDB\install.ps1
db\MongoDB\install.sh = db\MongoDB\install.sh
db\MongoDB\Navigations.js = db\MongoDB\Navigations.js
db\MongoDB\Roles.js = db\MongoDB\Roles.js
@ -43,7 +42,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MySQL", "MySQL", "{084E2E94-6B7D-4D3E-9BF1-6972427FBF80}"
ProjectSection(SolutionItems) = preProject
db\MySQL\initData.sql = db\MySQL\initData.sql
db\MySQL\install.ps1 = db\MySQL\install.ps1
db\MySQL\install.sh = db\MySQL\install.sh
db\MySQL\install.sql = db\MySQL\install.sql
db\MySQL\my.ini = db\MySQL\my.ini
@ -57,9 +55,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Postgresql", "Postgresql",
db\Postgresql\install.sql = db\Postgresql\install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess", "src\mvc\client\Bootstrap.Client.DataAccess\Bootstrap.Client.DataAccess.csproj", "{843811A2-FE49-410F-BF9F-9F1FB14A1DEE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess", "src\client\Bootstrap.Client.DataAccess\Bootstrap.Client.DataAccess.csproj", "{843811A2-FE49-410F-BF9F-9F1FB14A1DEE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess.MongoDB", "src\mvc\client\Bootstrap.Client.DataAccess.MongoDB\Bootstrap.Client.DataAccess.MongoDB.csproj", "{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess.MongoDB", "src\client\Bootstrap.Client.DataAccess.MongoDB\Bootstrap.Client.DataAccess.MongoDB.csproj", "{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6AD32A76-F3AA-423E-96EA-E5CC679934D1}"
EndProject
@ -67,6 +65,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{41B6D37A-5E5
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin", "admin", "{E03B7391-B52F-4449-B400-5CD9DE01F085}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{D8F90830-15D0-4031-94EE-6E5D93CB734A}"
ProjectSection(SolutionItems) = preProject
appveyor.build.ps1 = appveyor.build.ps1
appveyor.test.ps1 = appveyor.test.ps1
appveyor.yml = appveyor.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{E057452E-00EB-4C46-9F8D-14096AAE8148}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
@ -74,97 +79,36 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{E057452E-0
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{85574E7C-7D58-4135-AB4B-76678552D271}"
ProjectSection(SolutionItems) = preProject
src\admin\Bootstrap.Admin\Dockerfile = src\admin\Bootstrap.Admin\Dockerfile
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
scripts\windows\publish-admin.cmd = scripts\windows\publish-admin.cmd
scripts\windows\publish-client.cmd = scripts\windows\publish-client.cmd
scripts\windows\watch-run-admin.cmd = scripts\windows\watch-run-admin.cmd
scripts\windows\watch-run-client.cmd = scripts\windows\watch-run-client.cmd
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
scripts\linux\deploy-admin.sh = scripts\linux\deploy-admin.sh
scripts\linux\deploy-client.sh = scripts\linux\deploy-client.sh
scripts\linux\init.sh = scripts\linux\init.sh
scripts\linux\publish-admin.sh = scripts\linux\publish-admin.sh
scripts\linux\publish-client.sh = scripts\linux\publish-client.sh
scripts\linux\watch-run-admin.sh = scripts\linux\watch-run-admin.sh
scripts\linux\watch-run-client.sh = scripts\linux\watch-run-client.sh
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}") = "appveyor", "appveyor", "{5F732D4E-133B-4DA6-811B-C369CDC3FB89}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ci", "ci", "{5F732D4E-133B-4DA6-811B-C369CDC3FB89}"
ProjectSection(SolutionItems) = preProject
scripts\appveyor\appveyor.build.ps1 = scripts\appveyor\appveyor.build.ps1
scripts\appveyor\appveyor.install.ps1 = scripts\appveyor\appveyor.install.ps1
scripts\appveyor\appveyor.test.ps1 = scripts\appveyor\appveyor.test.ps1
appveyor.build.ps1 = appveyor.build.ps1
appveyor.test.ps1 = appveyor.test.ps1
appveyor.yml = appveyor.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "services", "services", "{68F7C160-3FB2-4129-8F89-96F78B2DA0A9}"
ProjectSection(SolutionItems) = preProject
scripts\linux\services\ba.admin.service = scripts\linux\services\ba.admin.service
scripts\linux\services\ba.client.service = scripts\linux\services\ba.client.service
scripts\linux\services\nginx.service = scripts\linux\services\nginx.service
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oracle", "Oracle", "{41E078CA-F005-4B66-B440-FD7EB731AD61}"
ProjectSection(SolutionItems) = preProject
db\Oracle\InitData.sql = db\Oracle\InitData.sql
db\Oracle\Install.sql = db\Oracle\Install.sql
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "git", "git", "{64EACBD1-23DD-4168-BEED-55D47DB1A8BB}"
ProjectSection(SolutionItems) = preProject
scripts\git\commit_msg_template.txt = scripts\git\commit_msg_template.txt
scripts\git\readme.md = scripts\git\readme.md
scripts\git\run.cmd = scripts\git\run.cmd
scripts\git\run.sh = scripts\git\run.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "blazor", "blazor", "{DAE3826B-AAAB-468A-9A06-2F56EF5C0767}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{C07631B9-5E5E-417A-9A16-3C88956D574E}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\docker.yml = .github\workflows\docker.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mvc", "mvc", "{C996F427-DA93-49D6-9804-4E665D195FC2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin", "admin", "{45ADEF9B-C8BD-4224-9E12-F6716E85A22C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{55A2459A-6BDE-4493-B2C0-5BE1673E99EE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapAdmin.Web", "src\blazor\admin\BootstrapAdmin.Web\BootstrapAdmin.Web.csproj", "{EF5EF5A4-616A-4BA7-9E1E-1407E8EC0395}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapAdmin.DataAccess.EFCore", "src\blazor\admin\BootstrapAdmin.DataAccess.EFCore\BootstrapAdmin.DataAccess.EFCore.csproj", "{D8ED2DF7-F7E1-4DE7-B097-D0BEE51D58E9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapAdmin.DataAccess.Models", "src\blazor\admin\BootstrapAdmin.DataAccess.Models\BootstrapAdmin.DataAccess.Models.csproj", "{7E3861AB-F797-4A9F-B7CE-0E35751FFCD9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapAdmin.DataAccess.PetaPoco", "src\blazor\admin\BootstrapAdmin.DataAccess.PetaPoco\BootstrapAdmin.DataAccess.PetaPoco.csproj", "{20D03C52-0F8B-47B6-BCA8-CF0812F82722}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapAdmin.Web.Core", "src\blazor\admin\BootstrapAdmin.Web.Core\BootstrapAdmin.Web.Core.csproj", "{DA143654-C258-410D-B5DC-FE446ED99CE4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapClient.DataAccess.PetaPoco", "src\blazor\client\BootstrapClient.DataAccess\BootstrapClient.DataAccess.PetaPoco.csproj", "{640F598B-6586-4AD6-B544-78CFF2602DFB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapClient.Web.Shared", "src\blazor\client\BootstrapClient.Shared\BootstrapClient.Web.Shared.csproj", "{93770088-3463-427B-9CD8-88B8D7945C83}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapClient.Web", "src\blazor\client\BootstrapClient.Web\BootstrapClient.Web.csproj", "{6CD7A35B-93A8-4DB2-B078-EE5A81F40032}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootStarpAdmin.DataAccess.FreeSql", "src\blazor\admin\BootStarpAdmin.DataAccess.FreeSql\BootStarpAdmin.DataAccess.FreeSql.csproj", "{11122D97-B349-4A3E-B7DD-73B8B363C47C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootStarpAdmin.DataAccess.SqlSugar", "src\blazor\admin\BootStarpAdmin.DataAccess.SqlSugar\BootStarpAdmin.DataAccess.SqlSugar.csproj", "{1D20E6CF-9825-4CDE-B732-AE586BD1AABA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapClient.Web.Core", "src\blazor\client\BootstrapClient.Web.Core\BootstrapClient.Web.Core.csproj", "{FFDF9FF9-0B29-47D3-AD42-53A476B570EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapClient.DataAccess.Models", "src\blazor\client\BootstrapClient.Web.Models\BootstrapClient.DataAccess.Models.csproj", "{CC3DF23A-2880-438F-BDEB-DB093E919ABA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapAdmin.Caching", "src\blazor\admin\BootstrapAdmin.Caching\BootstrapAdmin.Caching.csproj", "{ADD20515-1C1C-418B-84F6-8B05A7AA315B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -199,58 +143,6 @@ Global
{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}.Release|Any CPU.Build.0 = Release|Any CPU
{EF5EF5A4-616A-4BA7-9E1E-1407E8EC0395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF5EF5A4-616A-4BA7-9E1E-1407E8EC0395}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF5EF5A4-616A-4BA7-9E1E-1407E8EC0395}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF5EF5A4-616A-4BA7-9E1E-1407E8EC0395}.Release|Any CPU.Build.0 = Release|Any CPU
{D8ED2DF7-F7E1-4DE7-B097-D0BEE51D58E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8ED2DF7-F7E1-4DE7-B097-D0BEE51D58E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8ED2DF7-F7E1-4DE7-B097-D0BEE51D58E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8ED2DF7-F7E1-4DE7-B097-D0BEE51D58E9}.Release|Any CPU.Build.0 = Release|Any CPU
{7E3861AB-F797-4A9F-B7CE-0E35751FFCD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E3861AB-F797-4A9F-B7CE-0E35751FFCD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E3861AB-F797-4A9F-B7CE-0E35751FFCD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E3861AB-F797-4A9F-B7CE-0E35751FFCD9}.Release|Any CPU.Build.0 = Release|Any CPU
{20D03C52-0F8B-47B6-BCA8-CF0812F82722}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20D03C52-0F8B-47B6-BCA8-CF0812F82722}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20D03C52-0F8B-47B6-BCA8-CF0812F82722}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20D03C52-0F8B-47B6-BCA8-CF0812F82722}.Release|Any CPU.Build.0 = Release|Any CPU
{DA143654-C258-410D-B5DC-FE446ED99CE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA143654-C258-410D-B5DC-FE446ED99CE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA143654-C258-410D-B5DC-FE446ED99CE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA143654-C258-410D-B5DC-FE446ED99CE4}.Release|Any CPU.Build.0 = Release|Any CPU
{640F598B-6586-4AD6-B544-78CFF2602DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{640F598B-6586-4AD6-B544-78CFF2602DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{640F598B-6586-4AD6-B544-78CFF2602DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{640F598B-6586-4AD6-B544-78CFF2602DFB}.Release|Any CPU.Build.0 = Release|Any CPU
{93770088-3463-427B-9CD8-88B8D7945C83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93770088-3463-427B-9CD8-88B8D7945C83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93770088-3463-427B-9CD8-88B8D7945C83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93770088-3463-427B-9CD8-88B8D7945C83}.Release|Any CPU.Build.0 = Release|Any CPU
{6CD7A35B-93A8-4DB2-B078-EE5A81F40032}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CD7A35B-93A8-4DB2-B078-EE5A81F40032}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CD7A35B-93A8-4DB2-B078-EE5A81F40032}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CD7A35B-93A8-4DB2-B078-EE5A81F40032}.Release|Any CPU.Build.0 = Release|Any CPU
{11122D97-B349-4A3E-B7DD-73B8B363C47C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11122D97-B349-4A3E-B7DD-73B8B363C47C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11122D97-B349-4A3E-B7DD-73B8B363C47C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11122D97-B349-4A3E-B7DD-73B8B363C47C}.Release|Any CPU.Build.0 = Release|Any CPU
{1D20E6CF-9825-4CDE-B732-AE586BD1AABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D20E6CF-9825-4CDE-B732-AE586BD1AABA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D20E6CF-9825-4CDE-B732-AE586BD1AABA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D20E6CF-9825-4CDE-B732-AE586BD1AABA}.Release|Any CPU.Build.0 = Release|Any CPU
{FFDF9FF9-0B29-47D3-AD42-53A476B570EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFDF9FF9-0B29-47D3-AD42-53A476B570EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFDF9FF9-0B29-47D3-AD42-53A476B570EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFDF9FF9-0B29-47D3-AD42-53A476B570EC}.Release|Any CPU.Build.0 = Release|Any CPU
{CC3DF23A-2880-438F-BDEB-DB093E919ABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC3DF23A-2880-438F-BDEB-DB093E919ABA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC3DF23A-2880-438F-BDEB-DB093E919ABA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC3DF23A-2880-438F-BDEB-DB093E919ABA}.Release|Any CPU.Build.0 = Release|Any CPU
{ADD20515-1C1C-418B-84F6-8B05A7AA315B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADD20515-1C1C-418B-84F6-8B05A7AA315B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADD20515-1C1C-418B-84F6-8B05A7AA315B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADD20515-1C1C-418B-84F6-8B05A7AA315B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -259,7 +151,7 @@ Global
{87319AF5-7C40-4362-B67C-35F9DD737DB4} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A} = {E03B7391-B52F-4449-B400-5CD9DE01F085}
{C82A6E45-AB90-43D1-8429-5CBE953D8151} = {C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}
{C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0} = {C996F427-DA93-49D6-9804-4E665D195FC2}
{C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0} = {41B6D37A-5E5E-42B3-85E4-D81A81E3D757}
{8D62BE79-BE13-43C8-969B-C9B00B3C84B7} = {E03B7391-B52F-4449-B400-5CD9DE01F085}
{523515EC-2AD7-4282-9AF4-9D20371183B0} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{8336F096-4B4A-4710-A1FA-0F5E44CD8D26} = {E03B7391-B52F-4449-B400-5CD9DE01F085}
@ -269,30 +161,10 @@ Global
{6F61C2AC-84D4-48A9-8A48-680657CC8175} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{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} = {C996F427-DA93-49D6-9804-4E665D195FC2}
{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}
{68F7C160-3FB2-4129-8F89-96F78B2DA0A9} = {FDCFC3E3-14CF-40B2-9FE5-5BC239AAC110}
{41E078CA-F005-4B66-B440-FD7EB731AD61} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{64EACBD1-23DD-4168-BEED-55D47DB1A8BB} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4}
{DAE3826B-AAAB-468A-9A06-2F56EF5C0767} = {41B6D37A-5E5E-42B3-85E4-D81A81E3D757}
{C996F427-DA93-49D6-9804-4E665D195FC2} = {41B6D37A-5E5E-42B3-85E4-D81A81E3D757}
{45ADEF9B-C8BD-4224-9E12-F6716E85A22C} = {DAE3826B-AAAB-468A-9A06-2F56EF5C0767}
{55A2459A-6BDE-4493-B2C0-5BE1673E99EE} = {DAE3826B-AAAB-468A-9A06-2F56EF5C0767}
{EF5EF5A4-616A-4BA7-9E1E-1407E8EC0395} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{D8ED2DF7-F7E1-4DE7-B097-D0BEE51D58E9} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{7E3861AB-F797-4A9F-B7CE-0E35751FFCD9} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{20D03C52-0F8B-47B6-BCA8-CF0812F82722} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{DA143654-C258-410D-B5DC-FE446ED99CE4} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{640F598B-6586-4AD6-B544-78CFF2602DFB} = {55A2459A-6BDE-4493-B2C0-5BE1673E99EE}
{93770088-3463-427B-9CD8-88B8D7945C83} = {55A2459A-6BDE-4493-B2C0-5BE1673E99EE}
{6CD7A35B-93A8-4DB2-B078-EE5A81F40032} = {55A2459A-6BDE-4493-B2C0-5BE1673E99EE}
{11122D97-B349-4A3E-B7DD-73B8B363C47C} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{1D20E6CF-9825-4CDE-B732-AE586BD1AABA} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
{FFDF9FF9-0B29-47D3-AD42-53A476B570EC} = {55A2459A-6BDE-4493-B2C0-5BE1673E99EE}
{CC3DF23A-2880-438F-BDEB-DB093E919ABA} = {55A2459A-6BDE-4493-B2C0-5BE1673E99EE}
{ADD20515-1C1C-418B-84F6-8B05A7AA315B} = {45ADEF9B-C8BD-4224-9E12-F6716E85A22C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {221EAE38-5F75-4391-9A48-E462A9F3B8FC}

View File

@ -1,5 +1,4 @@
<Project>
<PropertyGroup>
<Copyright>Longbow</Copyright>
<Authors>Argo Zhang(argo@163.com)</Authors>
@ -9,19 +8,22 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)src\Keys\Longbow.Utility.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Target Condition=" $(IsWebProject) == true Or $(IsTestProject) == true" Name="PostBuild" AfterTargets="PostBuildEvent">
<Message Text="Copy lic file -> $(TargetDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)src\mvc\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)src/mvc/admin/keys/Longbow.lic" SkipUnchangedFiles="true" />
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup>
<Target Condition=" '$(TargetFramework)' == 'netcoreapp2.2' " Name="PostPublish" AfterTargets="Publish">
<Message Text="Publish -> $(PublishDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src/admin/keys/Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\Bootstrap.Admin\BootstrapAdmin.db" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src/admin/Bootstrap.Admin/BootstrapAdmin.db" SkipUnchangedFiles="true" />
</Target>
<Target Condition=" $(IsWebProject) == true " Name="PostPublish" AfterTargets="Publish">
<Message Text="Publish lic file -> $(PublishDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src\mvc\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src/mvc/admin/keys/Longbow.lic" SkipUnchangedFiles="true" />
<Message Text="Publish db file -> $(PublishDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src\mvc\admin\Bootstrap.Admin\BootstrapAdmin.db" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(PublishDir)" SourceFiles="$(MSBuildThisFileDirectory)src/mvc/admin/Bootstrap.Admin/BootstrapAdmin.db" SkipUnchangedFiles="true" />
<Target Condition=" '$(TargetFramework)' == 'netcoreapp2.2' " Name="PostBuild" AfterTargets="PostBuildEvent">
<Message Text="Copy file -> $(TargetDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)src\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)src/admin/keys/Longbow.lic" SkipUnchangedFiles="true" />
</Target>
</Project>
</Project>

284
LICENSE
View File

@ -1,165 +1,191 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
0. Additional Definitions.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
1. Exception to Section 3 of the GNU GPL.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Conveying Modified Versions.
2. Grant of Copyright License.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
3. Grant of Patent License.
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
3. Object Code Incorporating Material from Library Header Files.
4. Redistribution.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
5. Submission of Contributions.
4. Combined Works.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
6. Trademarks.
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
7. Disclaimer of Warranty.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
d) Do one of the following:
8. Limitation of Liability.
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
9. Accepting Warranty or Additional Liability.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
5. Combined Libraries.
END OF TERMS AND CONDITIONS
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
APPENDIX: How to apply the Apache License to your work
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "{}" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
Copyright 2019 LaoGanDie
6. Revised Versions of the GNU Lesser General Public License.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
http://www.apache.org/licenses/LICENSE-2.0
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

175
README.md
View File

@ -1,8 +1,169 @@
# 第一点
## 部署手册
# BootstrapAdmin
# 第二点
## 环境要求
# 第三点
## 软件要求
<span>English</span> | <a href="README.zh-CN.md">中文</a>
---
##### Version & Coverage
[![Release](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=red&color=green&label=release&url=https://ba.sdgxgz.com/api/Gitee/Releases)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases)
[![Coveralls](https://img.shields.io/coveralls/github/ArgoZhang/BootstrapAdmin/master.svg?logo=ReverbNation&logoColor=green&label=coveralls)](https://coveralls.io/github/ArgoZhang/BootstrapAdmin)
[![Codecov](https://img.shields.io/codecov/c/gh/argozhang/bootstrapadmin/master.svg?logo=codecov&label=codecov)](https://codecov.io/gh/argozhang/bootstrapadmin/branch/master)
##### Gitee
[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&color=blueviolet&url=https://ba.sdgxgz.com/api/Gitee/Builds?projName=bootstrapadmin-9m1jm)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
[![Build Status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&label=maser)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
[![Test](https://img.shields.io/appveyor/tests/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm/build/tests)
[![Issue Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=critical&label=issues&url=https://ba.sdgxgz.com/api/Gitee/Issues)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues)
[![Pull Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=green&color=success&label=pulls&url=https://ba.sdgxgz.com/api/Gitee/Pulls)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/pulls)
##### GitHub
[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&color=blueviolet&url=https://ba.sdgxgz.com/api/Gitee/Builds?projName=bootstrapadmin)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin)
[![master status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin/master.svg?logo=appveyor&label=master)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master)
[![Test](https://img.shields.io/appveyor/tests/argozhang/bootstrapadmin/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master/tests)
[![Repo Size](https://img.shields.io/github/repo-size/ArgoZhang/BootstrapAdmin.svg?logo=github&logoColor=green&label=repo)](https://github.com/ArgoZhang/BootstrapAdmin)
[![Commit Date](https://img.shields.io/github/last-commit/ArgoZhang/BootstrapAdmin/master.svg?logo=github&logoColor=green&label=commit)](https://github.com/ArgoZhang/BootstrapAdmin)
## Introduce
Because the dependent on Bootstrap v4, so it is called **Bootstrap Admin**. This system can be integrated with asp.net and asp.net core applications. The database supports multiple databases at the same time. The detailed list is shown in the following **database** detailed list. Switching the data source only needs to change the configuration file without restarting the application. The configuration is simple and flexible. The UI front-end uses the popular Bootstrap framework layout, which is very compatible with mobile devices and adapts to almost all terminal devices in the current market. The system also has the feature of single background supporting multi-front desk, and provides the ability of **single sign-on (SSO)**.
### Notes
Bootstrap Admin does not require secondary development, but only integration with the front-end system. The front-end system model project is **Bootstrap. Client**
The original starting point of the project is to separate the privilege system from the business system. The project development focuses on functions. For detailed configuration instructions, please click on [View Documents](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E7%B3%BB%E7%BB%9F%E9%89B%86%E6%88%90).
### Features
1. Integration with Front-end Website through Configuration
2. Constructing Hierarchical Menu of Front-end System
3. Provide a single background to support multiple front-end application configurations
4. Provide single sign-on(SSO)
5. Integrated System Authentication and Authorization Module
6. Provide role, department, user, menu, foreground application authorization
Role Authorization to Users
Role-to-Menu Authorization
Role Authorization to Departments
Role-to-application authorization (multiple front-end applications share a back-end privilege management system)
Departments Authorize Users
7. Provide dictionary tables for personalized configuration of front-end websites
8. Fully responsive layout (supporting all mainstream devices such as computers, tablets, mobile phones, etc.)
9. Built-in multi-data source support, simple configuration and immediate effect without restart
10. Built-in data memory caching mechanism, page fast response
11. Built-in Data **Operation Log** and User **Log on**
### Advantage
1. The front-end system does not need to write login, authorization and authentication modules; it is only responsible for writing business modules.
2. Background system can be used directly without any secondary development.
3. Front-end and back-end systems are separated, which are different systems (domain name can be independent)
4. Extensible to multi-tenant applications
For more information, please click [wiki](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D?sort_id=1333473)
### Database
**MSSQL/Oracle/SQLite/MySql/MariaDB/Postgresql/Firebird/MsAccess/MongoDB**
### Browser
![chrome](https://img.shields.io/badge/chrome->%3D4.5-success.svg?logo=google%20chrome&logoColor=red)
![firefox](https://img.shields.io/badge/firefox->38-success.svg?logo=mozilla%20firefox&logoColor=red)
![edge](https://img.shields.io/badge/edge->%3D12-success.svg?logo=microsoft%20edge&logoColor=blue)
![ie](https://img.shields.io/badge/ie->%3D11-success.svg?logo=internet%20explorer&logoColor=blue)
![Safari](https://img.shields.io/badge/safari->%3D9-success.svg?logo=safari&logoColor=blue)
![Andriod](https://img.shields.io/badge/andriod->%3D4.4-success.svg?logo=android)
![oper](https://img.shields.io/badge/opera->%3D3.0-success.svg?logo=opera&logoColor=red)
```json
"browserslist": [
"Chrome >= 45",
"Firefox >= 38",
"Edge >= 12",
"Explorer >= 11",
"iOS >= 9",
"Safari >= 9",
"Android >= 4.4",
"Opera >= 30"
]
```
### Mobile
![ios](https://img.shields.io/badge/ios-supported-success.svg?logo=apple&logoColor=white)
![Andriod](https://img.shields.io/badge/andriod-suported-success.svg?logo=android)
![windows](https://img.shields.io/badge/windows-suported-success.svg?logo=windows&logoColor=blue)
| | **Chrome** | **Firefox** | **Safari** | **Android Browser & WebView** | **Microsoft Edge** |
| ------- | --------- | --------- | ------ | ------------------------- | -------------- |
| **iOS** | Supported | Supported | Supported | N/A | Supported |
| **Android** | Supported | Supported | N/A | Android v5.0+ supported | Supported |
| **Windows 10 Mobile** | N/A | N/A | N/A | N/A | Supported |
### Desktop
![macOS](https://img.shields.io/badge/macOS-supported-success.svg?logo=apple&logoColor=white)
![linux](https://img.shields.io/badge/linux-suported-success.svg?logo=linux&logoColor=white)
![windows](https://img.shields.io/badge/windows-suported-success.svg?logo=windows)
| | Chrome | Firefox | Internet Explorer | Microsoft Edge | Opera | Safari |
| ------- | --------- | --------- | ----------------- | -------------- | --------- | ------------- |
| Mac | Supported | Supported | N/A | N/A | Supported | Supported |
| Linux | Supported | Supported | N/A | N/A | N/A | N/A |
| Windows | Supported | Supported | Supported, IE10+ | Supported | Supported | Not supported |
## QQ Group
[![QQ](https://img.shields.io/badge/QQ-795206915-green.svg?logo=tencent%20qq&logoColor=red)](https://shang.qq.com/wpa/qunwpa?idkey=d381355e50ff91db410c3da3eadb081ba859f64c2877e86343f4709b171f28b8)
## Installation
1. Install .net core sdk [Offical website](http://www.microsoft.com/net/download)
2. Install Visual Studio IDE 2017 lastest [Offical website](https://visualstudio.microsoft.com/vs/getting-started/)
3. Git clone `git clone https://github.com/ArgoZhang/BootstrapAdmin.git`
4. Login as Admin/123789
## Branchs
**master** Synchronized with Online Demo
**dev** env: windows + SQLite
**dev-Tabs** Multiple tabs branch
**dev-Localization** support multiple language branch
## Online Demonstration
[![website1](https://img.shields.io/badge/linux-http://ba.zylweb.cn-success.svg?logo=buzzfeed&logoColor=green)](http://ba.zylweb.cn)
[![website2](https://img.shields.io/badge/windows-http://ba.sdgxgz.com-success.svg?logo=buzzfeed&logoColor=green)](http://ba.sdgxgz.com)
### Login
Administrator: Admin/123789
User: User/123789
## Docker Images
[![Docker](https://img.shields.io/docker/cloud/automated/argozhang/ba.svg?logo=docker&logoColor=success)](https://hub.docker.com/r/argozhang/ba)
[![Docker](https://img.shields.io/docker/cloud/build/argozhang/ba.svg?logo=docker&logoColor=success)](https://hub.docker.com/r/argozhang/ba/builds)
### Docker Hub
Mirror [Portal](https://hub.docker.com/r/argozhang/ba)
```bash
docker pull argozhang/ba
```
### Qiniu Cloud:
Mirror [Portal](https://hub.qiniu.com/store/argozhang/ba)
```bash
docker pull reg.qiniu.com/argozhang/ba
```
## Configurations
Detailed configuration instructions please click [wikis](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis)
## Q&A
Please click [wikis](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98Q&A)
## License
[![Gitee license](https://img.shields.io/github/license/argozhang/bootstrapadmin.svg?logo=git&logoColor=red)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/blob/master/LICENSE)
## GVP award
[View](https://images.gitee.com/uploads/images/2019/0516/124055_96cc9f8d_554725.png "GiteeGVP.png")
## Screenshots
Home
![Home](https://gitee.com/LongbowEnterprise/Pictures/raw/master/BootstrapAdmin/BA02-01.png "BAHome-01.png")
For more screenshots, Click [wiki](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis)
## Contribution
1. Fork
2. Create Feat_xxx branch
3. Commit
4. Create Pull Request

View File

@ -5,38 +5,28 @@
---
##### Version & Coverage
[![Release](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=red&color=green&label=release&url=https://admin.blazor.zone/api/Gitee/Releases?userName=LongbowEnterprise)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases)
[![Coveralls](https://img.shields.io/coveralls/github/ArgoZhang/BootstrapAdmin/master.svg?logo=ReverbNation&logoColor=green&label=coveralls)](https://coveralls.io/github/ArgoZhang/BootstrapAdmin?branch=master)
[![Release](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=red&color=green&label=release&url=https://ba.sdgxgz.com/api/Gitee/Releases)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases)
[![Coveralls](https://img.shields.io/coveralls/github/ArgoZhang/BootstrapAdmin/master.svg?logo=ReverbNation&logoColor=green&label=coveralls)](https://coveralls.io/github/ArgoZhang/BootstrapAdmin)
[![Codecov](https://img.shields.io/codecov/c/gh/argozhang/bootstrapadmin/master.svg?logo=codecov&label=codecov)](https://codecov.io/gh/argozhang/bootstrapadmin/branch/master)
##### Gitee
[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&color=blueviolet&url=https://admin.blazor.zone/api/Gitee/Builds?projName=bootstrapadmin-9m1jm)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
[![Build Status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&label=master)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm/branch/master)
[![Test](https://img.shields.io/appveyor/tests/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm/branch/master/tests)
[![Issue Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=critical&label=issues&url=https://admin.blazor.zone/api/Gitee/Issues?userName=LongbowEnterprise)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues)
[![Pull Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=green&color=success&label=pulls&url=https://admin.blazor.zone/api/Gitee/Pulls?userName=LongbowEnterprise)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/pulls)
[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&color=blueviolet&url=https://ba.sdgxgz.com/api/Gitee/Builds?projName=bootstrapadmin-9m1jm)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
[![Build Status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&label=maser)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm)
[![Test](https://img.shields.io/appveyor/tests/ArgoZhang/bootstrapadmin-9m1jm/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin-9m1jm/build/tests)
[![Issue Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=critical&label=issues&url=https://ba.sdgxgz.com/api/Gitee/Issues)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues)
[![Pull Status](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=green&color=success&label=pulls&url=https://ba.sdgxgz.com/api/Gitee/Pulls)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/pulls)
##### GitHub
[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&color=blueviolet&url=https://admin.blazor.zone/api/Gitee/Builds?projName=bootstrapadmin)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin)
[![Appveyor build](https://img.shields.io/endpoint.svg?logo=appveyor&label=build&color=blueviolet&url=https://ba.sdgxgz.com/api/Gitee/Builds?projName=bootstrapadmin)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin)
[![master status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin/master.svg?logo=appveyor&label=master)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master)
[![Test](https://img.shields.io/appveyor/tests/argozhang/bootstrapadmin/master.svg?logo=appveyor&)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master/tests)
[![Github build](https://img.shields.io/github/workflow/status/ArgoZhang/BootstrapAdmin/Auto%20Build%20CI/master?label=master&logoColor=green&logo=github)](https://github.com/ArgoZhang/BootstrapAdmin/actions?query=workflow%3A%22Auto+Build+CI%22+branch%3Amaster)
[![Repo Size](https://img.shields.io/github/repo-size/ArgoZhang/BootstrapAdmin.svg?logo=github&logoColor=green&label=repo)](https://github.com/ArgoZhang/BootstrapAdmin)
[![Commit Date](https://img.shields.io/github/last-commit/ArgoZhang/BootstrapAdmin/master.svg?logo=github&logoColor=green&label=commit)](https://github.com/ArgoZhang/BootstrapAdmin)
## 项目介绍
一直需要一款后台管理系统,但是网上很多开源项目都是 **Java** 开发的,本人是 **NET** 平台的对 **Java** 一窍不通C#版本的本来就少而且还没有合适的。于是决定自己开发一套后台管理系统。由于前台采用 **Bootstrap** 布局样式,所以就叫做 **BootstrapAdmin** 。本系统可以用于所有的 Web 应用程序,目前版本已经升级到 **NET CORE** 具备跨平台能力。数据库方面同时支持多种数据库,详细列表见后面**数据库**的详细列表切换数据源仅需更改配置文件无需重启应用程序配置简单灵活。UI 前端使用流行的 Bootstrap 框架布局对移动设备的兼容性非常好,自适应目前市场几乎所有终端设备。本系统还具备单一后台支持多前台的特色,提供 **单点登录SSO** 的能力。
使用 NET Core + Bootstrap + PetaPoco + HTML 5 + jQuery 构建的后台管理平台
**BootstrapAdmin****开源驰骋 ccflow** 达成如下协议.
1. 驰骋工作流引擎、表单引擎、快速开发平台系统采用 `GPL` 协议.
2. 驰骋 `.net` 版本成为 `ccflow`, `java` 版本成为 `jflow` 两个版本代码 100% 开源.
3. 与 BootstrapAdmin 签订服务合同的并且付费的 BootstrapAdmin 客户使用ccflow不开源系统代码受到法律保护.
4. 驰骋 BPM 代码下载地址: [传送门](http://ccflow.org/down.htm?from=argo)
<a href='http://ccflow.org/?from=argo' target=_blank ><img src='https://images.gitee.com/uploads/images/2021/0718/172630_7ebb560a_554725.png' /></a>
使用 HTML 5 + jQuery + NET Core 2.2 + Bootstrap 4.1 + PetaPoco 构建的后台管理平台
### 特别说明
**BootstrapAdmin** 无需二次开发,要做的仅仅是与前台系统集成,前台系统模板工程为 **Bootstrap.Client**
@ -61,23 +51,17 @@
11. 内置数据 **操作日志** 与用户 **登录日志**
跟踪记录用户 **登录主机地点** **浏览器** **操作系统** 信息
更新日志:[传送门](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/更新日志)
### 优势
1. 前台系统不用编写登录、授权、认证模块;只负责编写业务模块即可
2. 后台系统无需任何二次开发,直接发布即可使用
3. 前台与后台系统分离,分别为不同的系统(域名可独立)
4. 可扩展为多租户应用
详细资料请点击 [查看文档](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D)
详细资料请点击 [查看文档](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D?sort_id=1333473)
### 数据库
数据库支持列表如下:
**MSSQL/Oracle/SQLite/MySql/MariaDB/Postgresql/Firebird/MongoDB**
### 工作流
**驰骋工作流** 进行深度集成,欢迎访问其主页 [传送门](http://ccflow.org/?from=argo)
**MSSQL/Oracle/SQLite/MySql/MariaDB/Postgresql/Firebird/MsAccess/MongoDB**
### 浏览器支持
@ -129,37 +113,34 @@
## 开发环境搭建
1. 安装 .net core sdk [官方网址](http://www.microsoft.com/net/download)
2. 安装 Visual Studio 2019 最新版 [官方网址](https://visualstudio.microsoft.com/vs/getting-started/)
3. 获取本项目代码 [BootstrapAdmin](https://gitee.com/LongbowEnterprise/BootstrapAdmin)
环境搭建教程 [详细说明](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B?sort_id=1333477)
2. 安装 Visual Studio IDE 2017以上 [官方网址](https://visualstudio.microsoft.com/vs/getting-started/)
3. 获取本项目代码 [BootstrapAdmin](https://gitee.com/LongbowEnterprise/BootstrapAdmin)
4. 系统登录用户名与口令
用户名:**Admin**
密码:**123789**
### 安装数据库
本项目默认使用 SQLite 数据库,内置数据库脚本
1. SQLite
2. SqlServer
3. MySql
4. Oracle
5. MongoDB
数据库配置 [详细说明](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/数据库连接配置?sort_id=1333482)
系统默认使用 SQLite 数据库,如需更改为其他数据库,执行解决方案中 DatabaseScripts目录下相对应脚本
Install.sql 创建数据库脚本
InitData.sql 初始化数据脚本
## 分支说明
分支说明 [详细说明](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/分支说明)
**master** 发布分支与在线演示版本同步
**dev** 开发分支目前开发环境配置是 windows + SQLite
**dev-Tabs** 利用 IFrame 多标签样式分支
**dev-Localization** 支持多国语言分支
## 演示地址
[![website1](https://img.shields.io/badge/linux-http://ba.zylweb.cn-success.svg?logo=buzzfeed&logoColor=green)](http://ba.zylweb.cn)
[![website2](https://img.shields.io/badge/linux-http://admin.blazor.zone-success.svg?logo=buzzfeed&logoColor=green)](http://admin.blazor.zone)
[![website2](https://img.shields.io/badge/windows-http://ba.sdgxgz.com-success.svg?logo=buzzfeed&logoColor=green)](http://ba.sdgxgz.com)
### 登录用户名与密码
管理账号Admin/123789
普通账号User/123789
管理员:**Admin/123789**
普通用户:**User/123789**
## Docker 镜像
[![Docker](https://img.shields.io/docker/cloud/automated/argozhang/ba.svg?logo=docker&logoColor=success)](https://hub.docker.com/r/argozhang/ba)
[![Docker](https://img.shields.io/docker/cloud/build/argozhang/ba.svg?logo=docker&logoColor=success)](https://hub.docker.com/r/argozhang/ba/builds)
[![Docker](https://img.shields.io/github/workflow/status/ArgoZhang/BootstrapAdmin/Docker%20Image%20CI/master?label=Docker%20Image%20CI&logo=github&logoColor=green)](https://github.com/ArgoZhang/BootstrapAdmin/actions?query=workflow%3A%22Docker+Image+CI%22%3Amaster)
### Docker Hub
镜像拉取 [传送门](https://hub.docker.com/r/argozhang/ba)
@ -182,7 +163,7 @@ docker pull reg.qiniu.com/argozhang/ba
[![Gitee license](https://img.shields.io/github/license/argozhang/bootstrapadmin.svg?logo=git&logoColor=red)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/blob/master/LICENSE)
## GVP 奖杯
![项目奖杯](https://images.gitee.com/uploads/images/2021/0112/112021_9d570be1_554725.png "GVP.png")
[查看照片](https://images.gitee.com/uploads/images/2019/0516/124055_96cc9f8d_554725.png "GiteeGVP.png")
## 项目截图
@ -193,12 +174,10 @@ docker pull reg.qiniu.com/argozhang/ba
更多截图请点击 [查看文档](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis) 查看项目截图小节
## 特别鸣谢
1. <a href="https://gitee.com/571183806" target="_blank">**云龙**</a> 提供云服务器搭建在线演示系统
2. <a href="https://gitee.com/Ysmc" target="_blank">**一事冇诚**</a> 对 MongoDB 数据库提供了详细测试
3. <a href="https://gitee.com/Axxbis" target="_blank">**爱吃油麦菜**</a> 提供云服务器与二级域名搭建备份演示系统、测试环境以及图床
4. <a href="https://gitee.com/kasenhoo" target="_blank">**kasenhoo**</a> 对 CentOS + MySql 环境提供详细测试
5. <a href="https://gitee.com/finally44177" target="_blank">**finally44177**</a> 提供 AdminLTE UI 样式 PR 对 MongoDB 数据库提供了详细测试
## 参与贡献
@ -206,13 +185,3 @@ docker pull reg.qiniu.com/argozhang/ba
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
## 相关视频讲解
[视频教材](https://gitee.com/LongbowEnterprise/BootstrapAdmin/wikis/%E8%AF%BE%E7%A8%8B%E5%88%97%E8%A1%A8?sort_id=1916635#%E8%AF%BE%E7%A8%8B%E5%88%97%E8%A1%A8)
## 捐助
如果这个项目对您有所帮助,请扫下方二维码打赏一杯咖啡。
<img src="https://gitee.com/LongbowEnterprise/Pictures/raw/master/WeChat/BarCode@2x.png" width="382px;" />

View File

@ -1,7 +1,7 @@
function installDB() {
write-host "init sqlserver database..." -ForegroundColor Cyan
$startPath = "$($env:appveyor_build_folder)\db\SqlServer"
$sqlInstance = "(local)\SQL2017"
$sqlInstance = "(local)\SQL2014"
$outFile = join-path $startPath "output.log"
$sqlFile = join-path $startPath "Install.sql"
$initFile = join-path $startPath "InitData.sql"
@ -38,41 +38,35 @@
function runUnitTest() {
write-host "dotnet test test\UnitTest" -ForegroundColor Cyan
dotnet test "test\UnitTest" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap.Admin*]*%2c[Bootstrap.DataAccess*]*" /p:Exclude="[*]*Program%2c[*]*Startup%2c[Bootstrap.DataAccess*]*AutoDB*%2c[Bootstrap.DataAccess]*WeChatHelper" /p:ExcludeByFile="**/SMSExtensions.cs%2c**/Helper/OAuthHelper.cs%2c**/Extensions/CloudLoggerExtensions.cs%2c**/Extensions/AutoGenerateDatabaseExtensions.cs%2c**/Api/HealthsController.cs%2c**/Pages/**%2c**/DBLogTask.cs%2c**/AutoDbHelper.cs" /p:CoverletOutput=..\..\
dotnet test test\UnitTest /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="..\..\src\admin\Bootstrap.Admin\Program.cs%2c..\..\src\admin\Bootstrap.Admin\Startup.cs%2c..\..\src\admin\Bootstrap.Admin\HttpHeaderOperation.cs" /p:CoverletOutput=..\..\
}
function installCoveralls() {
function coverallUnitTest() {
write-host "install coveralls.net tools" -ForegroundColor Cyan
dotnet tool install coveralls.net --tool-path ".\tools"
}
function reportCoveralls() {
Set-AppveyorBuildVariable COVERALLS_REPO_TOKEN $($env:COVERALLS_REPO_TOKEN)
dotnet tool install coveralls.net --version 1.0.0 --tool-path ".\tools"
runUnitTest
write-host "report UnitTest with Coveralls" -ForegroundColor Cyan
.\tools\csmacnz.Coveralls.exe --opencover -i coverage.opencover.xml --useRelativePaths
cmd.exe /c ".\tools\csmacnz.Coveralls.exe --opencover -i coverage.opencover.xml --useRelativePaths"
}
function installCodecov {
write-host "install codecov.tool tools" -ForegroundColor Cyan
dotnet tool install Codecov.Tool --tool-path ".\tools"
}
function reportCodecov() {
function codecovUnitTest() {
Set-AppveyorBuildVariable COVERALLS_REPO_TOKEN $($env:COVERALLS_REPO_TOKEN)
Set-AppveyorBuildVariable CODECOV_TOKEN $($env:CODECOV_TOKEN)
Set-AppveyorBuildVariable CI $($env:CI)
Set-AppveyorBuildVariable APPVEYOR $($env:Appveyor)
$coverageFile = Test-Path coverage.opencover.xml
if ($coverageFile) {
write-host "report UnitTest with Codecov" -ForegroundColor Cyan
.\tools\codecov -f coverage.opencover.xml
$codecovCmd = "C:\ProgramData\chocolatey\lib\codecov\tools\codecov.exe"
$codecov = Test-Path $codecovCmd
if (!$codecov) {
write-host "install codecov tools" -ForegroundColor Cyan
choco install codecov
}
$coverageFile = Test-Path coverage.opencover.xml
if (!$coverageFile) {
runUnitTest
}
write-host "report UnitTest with Codecov" -ForegroundColor Cyan
cmd.exe /c "$codecovCmd -f ""coverage.opencover.xml"""
}
installDB
installCoveralls
installCodecov
runUnitTest
reportCoveralls
reportCodecov
coverallUnitTest
codecovUnitTest

View File

@ -1,15 +1,12 @@
version: 5.0.{build}
version: 1.0.{build}
branches:
only:
- release
- master
- dev
image: Visual Studio 2019
image: Visual Studio 2017
clone_depth: 1
init:
- ps: git version
environment:
CI: true
Appveyor: true
COVERALLS_REPO_TOKEN:
secure: 5L1b6XqSNTOfU1iZrARo5eUOi1HOleVO3VDCW0pr6yaspgkC5jxL+gBDK0OEY8EI
@ -19,21 +16,26 @@ environment:
secure: 6rKKLXCmy3HZBxW5SjoO4Ox7G09FC0NJgGnvukWkYyJ2rx1GCzu4JvmLin69SHRz
CODECOV_TOKEN_GITLAB:
secure: +22PuAn5seq4bbCVCly8zDFuyEV3m2NjW3QuM0+2gm4c8akwicNFmv2T/ZGd0Jpd
cache: C:\ProgramData\chocolatey\lib\codecov\tools
services:
- mssql2017
- mssql2014
- mysql
- mongodb
install:
- ps: >-
.\scripts\appveyor\appveyor.install.ps1
#copy my.ini into mysql folder
dotnet --version
xcopy "$($env:appveyor_build_folder)\db\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y
build_script:
- ps: >-
.\scripts\appveyor\appveyor.build.ps1
.\appveyor.build.ps1
test_script:
- ps: >-
.\scripts\appveyor\appveyor.test.ps1
.\appveyor.test.ps1
artifacts:
- path: src\admin\Bootstrap.Admin\bin\release\net5.0\publish\
- path: src\admin\Bootstrap.Admin\bin\release\netcoreapp2.2\publish\
name: BootstrapAdmin
type: WebDeployPackage
deploy:
@ -71,4 +73,4 @@ notifications:
</div>
on_build_success: true
on_build_failure: true
on_build_status_changed: false
on_build_status_changed: false

View File

@ -13,8 +13,8 @@
},
{
"Category": "应用程序",
"Name": "后台管理",
"Code": "BA",
"Name": "未设置",
"Code": "0",
"Define": NumberInt(0)
},
{
@ -108,7 +108,7 @@
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "当前样式",
"Name": "使用样式",
"Code": "blue.css",
"Define": NumberInt(0)
@ -140,144 +140,108 @@
{
"Category": "应用程序",
"Name": "测试平台",
"Code": "Demo",
"Code": "2",
"Define": NumberInt(0)
},
{
"Category": "测试平台",
"Name": "网站标题",
"Code": "前台演示系统",
"Code": "托盘组垛程序",
"Define": NumberInt(1)
},
{
"Category": "测试平台",
"Name": "网站页脚",
"Code": "前台演示程序后台权限管理框架",
"Code": "通用后台管理测试平台",
"Define": NumberInt(1)
},
{
"Category": "测试平台",
"Name": "个人中心地址",
"Code": "/Admin/Profiles",
"Code": "http://localhost:50852/Admin/Profiles",
"Define": NumberInt(1)
},
{
"Category": "测试平台",
"Name": "系统设置地址",
"Code": "/Admin/Index",
"Code": "http://localhost:50852/Admin/Index",
"Define": NumberInt(1)
},
{
"Category": "测试平台",
"Name": "系统通知地址",
"Code": "/Admin/Notifications",
"Code": "http://localhost:50852/Admin/Notifications",
"Define": NumberInt(1)
},
{
"Category": "应用首页",
"Name": "Demo",
"Code": "http://localhost:49185",
"Name": "2",
"Code": "http://localhost:49185/",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "程序异常保留时长",
"Code": "1",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "操作日志保留时长",
"Code": "12",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "登录日志保留时长",
"Code": "12",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "Cookie保留时长",
"Code": "7",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "IP地理位置接口",
"Code": "None",
"Define": NumberInt(0)
},
{
"Category": "地理位置服务",
"Name": "百度地图开放平台",
"Code": "BaiDuIPSvr",
"Define": NumberInt(0)
},
{
"Category": "地理位置服务",
"Name": "聚合地理位置",
"Code": "百度138地理位置",
"Define": NumberInt(0)
},
{
"Category": "地理位置服务",
"Name": "https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=6006&query=",
"Code": "BaiDuIP138Svr",
"Define": NumberInt(0)
},
{
"Category": "地理位置",
"Category": "系统设置",
"Name": "BaiDuIPSvr",
"Code": "http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=",
"Define": NumberInt(0)
},
{
"Category": "地理位置",
"Category": "系统设置",
"Name": "JuheIPSvr",
"Code": "http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=",
"Define": NumberInt(0)
},
{
"Category": "地理位置",
"Name": "BaiDuIP138Svr",
"Code": "https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=6006&query=",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "访问日志保留时长",
"Code": "1",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "IP请求缓存时长",
"Code": "10",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "演示系统",
"Code": "0",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "授权盐值",
"Code": "yjglE2eddCGcS7tTFTDd2DfvqXHgCnMhNhpmx9HJaC9l8GAZ",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "哈希结果",
"Code": "6jTT50HGuk8V+AIsiE4IfqjcER71PBN1DY7gqOLZE7E=",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Category": "系统设置",
"Name": "验证码图床",
"Code": "http://imgs.sdgxgz.com/images/",
"Define": NumberInt(0)
@ -300,12 +264,6 @@
"Code": "1",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "固定表头",
"Code": "1",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "OAuth 认证登录",
@ -323,77 +281,5 @@
"Name": "自动锁屏",
"Code": "0",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "Blazor",
"Code": "0",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "健康检查",
"Code": "0",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "默认应用程序",
"Code": "0",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "后台地址",
"Code": "http://localhost:50852",
"Define": NumberInt(0)
},
{
"Category": "测试平台",
"Name": "favicon",
"Code": "/favicon.ico",
"Define": NumberInt(1)
},
{
"Category": "测试平台",
"Name": "网站图标",
"Code": "/favicon.png",
"Define": NumberInt(1)
},
{
"Category": "系统首页",
"Name": "高仿码云",
"Code": "Login-Gitee",
"Define": NumberInt(0)
},
{
"Category": "系统首页",
"Name": "蓝色清新",
"Code": "Login-Blue",
"Define": NumberInt(0)
},
{
"Category": "系统首页",
"Name": "系统默认",
"Code": "Login",
"Define": NumberInt(0)
},
{
"Category": "系统首页",
"Name": "科技动感",
"Code": "Login-Tec",
"Define": NumberInt(0)
},
{
"Category": "系统首页",
"Name": "Admin-LTE",
"Code": "Login-LTE",
"Define": NumberInt(0)
},
{
"Category": "网站设置",
"Name": "登录界面",
"Code": "Login",
"Define": NumberInt(0)
}
];

View File

@ -9,7 +9,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b91"),
@ -21,7 +21,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a01"),
@ -33,7 +33,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a02"),
@ -45,7 +45,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a03"),
@ -57,7 +57,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a04"),
@ -69,7 +69,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a05"),
@ -81,7 +81,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a06"),
@ -93,7 +93,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("4bd7b8445fa31256f77e4a01"),
@ -105,7 +105,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b92"),
@ -117,7 +117,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b93"),
@ -129,7 +129,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b01"),
@ -141,7 +141,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b02"),
@ -153,7 +153,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b03"),
@ -165,7 +165,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b04"),
@ -177,7 +177,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b05"),
@ -189,7 +189,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b06"),
@ -201,7 +201,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b07"),
@ -213,19 +213,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b08"),
"ParentId": "5bd7b8445fa31256f77e4b93",
"Name": "默认应用",
"Order": NumberInt(80),
"Icon": "fa fa-fa",
"Url": "defaultApp",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b94"),
@ -237,7 +225,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b10"),
@ -249,7 +237,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b11"),
@ -261,7 +249,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b12"),
@ -273,7 +261,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b13"),
@ -285,31 +273,19 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b14"),
"ParentId": "0",
"Name": "图标页面",
"Order": NumberInt(50),
"Order": NumberInt(55),
"Icon": "fa fa-fa",
"Url": "~/Admin/IconView",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(1),
"Application": "BA"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b15"),
"ParentId": "0",
"Name": "侧边栏",
"Order": NumberInt(55),
"Icon": "fa fa-fa",
"Url": "~/Admin/Sidebar",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(1),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b95"),
@ -321,7 +297,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b20"),
@ -333,7 +309,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b21"),
@ -345,7 +321,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b22"),
@ -357,7 +333,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b23"),
@ -369,7 +345,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b24"),
@ -381,7 +357,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b96"),
@ -393,7 +369,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b30"),
@ -405,7 +381,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b31"),
@ -417,7 +393,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b32"),
@ -429,7 +405,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b33"),
@ -441,7 +417,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b34"),
@ -453,7 +429,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b35"),
@ -465,7 +441,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b36"),
@ -477,7 +453,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b97"),
@ -489,7 +465,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b40"),
@ -501,7 +477,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b41"),
@ -513,7 +489,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b42"),
@ -525,7 +501,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b43"),
@ -537,7 +513,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b44"),
@ -549,7 +525,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b98"),
@ -561,7 +537,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b50"),
@ -573,7 +549,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b51"),
@ -585,7 +561,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b52"),
@ -597,7 +573,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b99"),
@ -609,7 +585,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9a"),
@ -621,31 +597,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
},
{
"_id": ObjectId("1bd7b8445fa31256f77e4b9c"),
"ParentId": "5bd7b8445fa31256f77e4b9a",
"Name": "暂停",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "pause",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
},
{
"_id": ObjectId("1bd7b8445fa31256f77e4b9d"),
"ParentId": "5bd7b8445fa31256f77e4b9a",
"Name": "日志",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "info",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9b"),
@ -657,7 +609,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9c"),
@ -669,7 +621,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd9b3d868aa001661776f57"),
@ -681,7 +633,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd9b3d868aa001661776f58"),
@ -693,7 +645,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd9b3d868aa001661776f59"),
@ -705,7 +657,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd9b3d868aa001661776f60"),
@ -717,7 +669,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b89"),
@ -729,7 +681,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5cd7b8445fa31256f77e4b90"),
@ -741,7 +693,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9d"),
@ -753,7 +705,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b59"),
@ -765,7 +717,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b60"),
@ -777,7 +729,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9e"),
@ -789,7 +741,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9f"),
@ -801,7 +753,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4ba0"),
@ -813,7 +765,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4ba1"),
@ -825,7 +777,7 @@
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "BA"
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4ba2"),
@ -837,7 +789,7 @@
"Category": "1",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "Demo"
"Application": "2"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4ba4"),
@ -849,7 +801,7 @@
"Category": "1",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "Demo"
"Application": "2"
},
{
"_id": ObjectId("5bd9b3d868aa001661776f56"),
@ -861,6 +813,6 @@
"Category": "1",
"Target": "_self",
"IsResource": NumberInt(0),
"Application": "Demo"
"Application": "2"
}
];

View File

@ -10,6 +10,6 @@
"RoleName": "Default",
"Description": "默认用户,可访问前台页面",
"Menus": [],
"Apps": ["BA", "Demo"]
"Apps": []
}
];

View File

@ -1,5 +0,0 @@
# init mongodb data
@echo off
mongo ./init.js
mongo BootstrapAdmin --eval "printjson(db.getCollectionNames())"

View File

@ -1,4 +1,3 @@
#! /bin/bash
# init mongodb data
mongo ./init.js
mongo BootstrapAdmin --eval "printjson(db.getCollectionNames())"
mongo BootstrapAdmin --eval "printjson(db.getCollectionNames())"

View File

@ -2,12 +2,12 @@
-- User/123789
DELETE From Users where UserName in ('Admin', 'User');
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, Description) values ('Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', now(), now(), 'system', '系统默认创建');
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, Description, App) values ('User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', '测试账号', now(), now(), 'system', '系统默认创建', 'Demo');
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, Description, App) values ('User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', '测试账号', now(), now(), 'system', '系统默认创建', '2');
DELETE From Dicts Where Define = 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 ('应用程序', '后台管理', 'BA', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '未设置', '0', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '网站标题', '后台管理系统', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '网站页脚', '2016 © 通用后台管理系统', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统通知', '用户注册', '0', 0);
@ -26,13 +26,12 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('头像地址', '头像
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', '蓝色样式', 'blue.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', '黑色样式', 'black.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', 'AdminLTE', 'lte.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '使用样式', 'blue.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('当前样式', '使用样式', 'blue.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '前台首页', '~/Home/Index', 0);
-- 网站UI设置
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 ('网站设置', '短信验证码登录', '1', 0);
@ -42,49 +41,22 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'OAuth
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动锁屏时长', '30', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动锁屏', '0', 0);
-- 是否启用 Blazor 默认为 0 未启用
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'Blazor', '0', 0);
-- 是否启用 健康检查 默认为 0 未启用 1 启用
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 ('网站设置', '操作日志保留时长', '12', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '登录日志保留时长', '12', 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 ('系统设置', '操作日志保留时长', '12', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '登录日志保留时长', '12', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '访问日志保留时长', '1', 0);
-- 时长单位 天
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'Cookie保留时长', '7', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'IP地理位置接口', 'None', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置服务', '百度地图开放平台', 'BaiDuIPSvr', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置服务', '聚合地理位置', 'JuheIPSvr', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置服务', '百度138地理位置', 'BaiDuIP138Svr', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置', 'BaiDuIP138Svr', 'https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=6006&query=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'Cookie保留时长', '7', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'IP地理位置接口', 'None', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0);
-- 时长单位 分钟
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'IP请求缓存时长', '10', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '演示系统', '0', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '授权盐值', 'yjglE2eddCGcS7tTFTDd2DfvqXHgCnMhNhpmx9HJaC9l8GAZ', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '哈希结果', '6jTT50HGuk8V+AIsiE4IfqjcER71PBN1DY7gqOLZE7E=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '默认应用程序', '0', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '后台地址', 'http://localhost:50852', 0);
-- 系统登录首页设置
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', '高仿码云', 'Login-Gitee', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', '蓝色清新', 'Login-Blue', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', '系统默认', 'Login', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', '科技动感', 'Login-Tec', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', 'Admin-LTE', 'Login-LTE', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '登录界面', 'Login', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'IP请求缓存时长', '10', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '演示系统', '0', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
DELETE FROM Navigations Where Category = '0';
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
@ -105,14 +77,12 @@ INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResourc
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, IsResource) VALUES (@@identity - 7, '默认应用', 80, 'fa fa-fa', 'defaultApp', '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);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (0, '侧边栏', 55, 'fa fa-fa', '~/Admin/Sidebar', '0', 1);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '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);
@ -139,8 +109,6 @@ 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', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '暂停', 10, 'fa fa-fa', 'pause', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '日志', 20, 'fa fa-fa', 'info', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '系统日志', 130, 'fa fa-gears', '#', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
@ -157,11 +125,6 @@ INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 1, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 2, '图标集', 10, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
-- 控件集合菜单
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '控件集合', 170, 'fa fa-stethoscope', '#', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity, '行为式验证码', 10, 'fa fa-wrench', 'https://gitee.com/LongbowEnterprise/SliderCaptcha', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 1, '下拉框', 20, 'fa fa-bars', 'http://longbowenterprise.gitee.io/longbow-select/', '0');
DELETE FROM `Groups` WHERE GroupName = 'Admin';
INSERT INTO `Groups` (GroupCode, GroupName, Description) VALUES ('001', 'Admin', '系统默认组');
@ -184,32 +147,29 @@ INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigat
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Default' and ParentId in (select id from Navigations where Name in ('个人中心'));
-- Client Data
Delete From Dicts Where Category = '应用程序' and Code = 'Demo';
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '测试平台', 'Demo', 0);
Delete From Dicts Where Category = '应用首页' and Name = 'Demo';
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用首页', 'Demo', 'http://localhost:49185', 0);
Delete From Dicts Where Category = '应用程序' and Code = 2;
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '测试平台', 2, 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用首页', 2, 'http://localhost:49185/', 0);
Delete From Dicts Where Category = '测试平台';
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站标题', '前台演示系统', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站页脚', '前台演示程序后台权限管理框架', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '个人中心地址', '/Admin/Profiles', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统设置地址', '/Admin/Index', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统通知地址', '/Admin/Notifications', 1);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', 'favicon', '/favicon.ico', 1);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', '网站图标', '/favicon.png', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站标题', 'BA Client', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站页脚', '通用后台管理测试平台', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '个人中心地址', 'http://localhost:50852/Admin/Profiles', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统设置地址', 'http://localhost:50852/Admin/Index', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统通知地址', 'http://localhost:50852/Admin/Notifications', 1);
Delete from Navigations where Application = 'Demo';
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 'Demo');
Delete from Navigations where Application = 2;
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '测试页面', 20, 'fa fa-fa', '#', '1', 'Demo');
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (@@identity, '关于', 10, 'fa fa-fa', '~/Home/About', '1', 'Demo');
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '测试页面', 20, 'fa fa-fa', '#', '1', 2);
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (@@identity, '关于', 10, 'fa fa-fa', '~/Home/About', '1', 2);
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '返回码云', 20, 'fa fa-fa', 'https://gitee.com/LongbowEnterprise/BootstrapAdmin', '1', 'Demo');
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '返回码云', 20, 'fa fa-fa', 'https://gitee.com/LongbowEnterprise/BootstrapAdmin', '1', 2);
-- 菜单授权
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Default' and Application = 'Demo';
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Administrators' and Application= 2;
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Default' and Application = 2;
-- 角色对应用授权
DELETE From RoleApp where AppId in ('Demo', 'BA');
INSERT INTO RoleApp (AppId, RoleId) SELECT 'Demo', ID From Roles Where RoleName = 'Default';
INSERT INTO RoleApp (AppId, RoleId) SELECT 'BA', ID From Roles Where RoleName = 'Default';
DELETE From RoleApp where AppId = '2';
INSERT INTO RoleApp (AppId, RoleId) SELECT '2', ID From Roles Where RoleName = 'Default';

View File

@ -1,9 +0,0 @@
# init mysql database
$startPath = $args[0]
if ($startPath -eq $null) {
$startPath = "Z:\src\Longbow\BootstrapAdmin\db\SqlServer"
}
mysql -e "drop database if exists BootstrapAdmin; create database BootstrapAdmin;" -uroot
mysql -hlocalhost -uroot -DBootstrapAdmin < $startPath\install.sql
mysql -hlocalhost -uroot -DBootstrapAdmin < $startPath\initData.sql

View File

@ -1,5 +1,3 @@
#! /bin/bash
mysql -e "drop database if exists BootstrapAdmin; create database BootstrapAdmin;" -uroot
mysql -hlocalhost -uroot -DBootstrapAdmin < ~/src/Longbow/BootstrapAdmin/DatabaseScripts/MySQL/install.sql
mysql -hlocalhost -uroot -DBootstrapAdmin < ~/src/Longbow/BootstrapAdmin/DatabaseScripts/MySQL/initData.sql

View File

@ -68,7 +68,7 @@ CREATE TABLE Navigations(
Category VARCHAR (50) DEFAULT 0,
Target VARCHAR (10) DEFAULT '_self',
IsResource INT DEFAULT 0,
Application VARCHAR (200) DEFAULT 'BA'
Application VARCHAR (200) DEFAULT 0
);
CREATE TABLE NavigationRole(
@ -88,8 +88,7 @@ CREATE TABLE Logs(
City VARCHAR (50) NULL,
RequestUrl VARCHAR (500) NOT NULL,
RequestData MEDIUMTEXT NULL,
UserAgent VARCHAR (2000) NULL,
Referer VARCHAR (2000)
UserAgent VARCHAR (2000) NULL
);
CREATE TABLE `Groups`(
@ -178,17 +177,16 @@ CREATE TABLE Traces(
UserName VARCHAR (50) NOT NULL,
LogTime DATETIME NOT NULL,
IP VARCHAR (15) NOT NULL,
Browser VARCHAR (2000),
OS VARCHAR (2000),
Browser VARCHAR (50),
OS VARCHAR (50),
City VARCHAR (50),
RequestUrl VARCHAR (2000) NOT NULL,
UserAgent VARCHAR (2000) NULL,
Referer VARCHAR (2000)
RequestUrl VARCHAR (500) NOT NULL,
UserAgent VARCHAR (2000) NULL
);
CREATE TABLE DBLogs (
ID INTEGER PRIMARY KEY Auto_increment,
UserName VARCHAR (50) NULL,
`SQL` Text NOT NULL,
`SQL` VARCHAR (2000) NOT NULL,
LogTime DATETIME NOT NULL
);

View File

@ -1,10 +1,7 @@
[mysqld]
basedir=C:\\Program Files\\MySQL\\MySQL Server 5.7
datadir=C:\\Program Files\\MySQL\\MySQL Server 5.7\\data
character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
charcater_set_client=utf8
character_set_connection=utf8
character_set_results=utf8

View File

@ -1,214 +0,0 @@
-- ADMIN/123789
-- User/123789
DELETE From Users where UserName in ('Admin', 'User');
INSERT INTO Users (Id, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, Description) values (SEQ_USERS_ID.NEXTVAL, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', sysdate, sysdate, 'system', '系统默认创建');
INSERT INTO Users (Id, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, Description, App) values (SEQ_USERS_ID.NEXTVAL, 'User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', '测试账号', sysdate, sysdate, 'system', '系统默认创建', 'Demo');
DELETE From Dicts Where Define = 0;
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '菜单', '系统菜单', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '菜单', '外部菜单', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '应用程序', '后台管理', 'BA', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '网站标题', '后台管理系统', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '网站页脚', '2016 © 通用后台管理系统', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '系统通知', '用户注册', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '系统通知', '程序异常', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '系统通知', '数据库连接', '2', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '通知状态', '未处理', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '通知状态', '已处理', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '处理结果', '同意', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '处理结果', '拒绝', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '消息状态', '未读', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '消息状态', '已读', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '消息标签', '一般', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '消息标签', '紧要', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '头像地址', '头像路径', '~/images/uploader/', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '头像地址', '头像文件', 'default.jpg', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站样式', '蓝色样式', 'blue.css', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站样式', '黑色样式', 'black.css', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站样式', 'AdminLTE', 'lte.css', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '使用样式', 'blue.css', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '前台首页', '~/Home/Index', 0);
-- 网站UI设置
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '侧边栏状态', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '卡片标题状态', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '固定表头', '1', 0);
-- 登录配置
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '短信验证码登录', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', 'OAuth 认证登录', '1', 0);
-- 自动锁屏(秒)默认 30 秒
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '自动锁屏时长', '30', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '自动锁屏', '0', 0);
-- 是否启用 Blazor 默认为 0 未启用
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', 'Blazor', '0', 0);
-- 是否启用 健康检查 默认为 0 未启用 1 启用
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '健康检查', '1', 0);
-- 时长单位 月
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '程序异常保留时长', '1', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '操作日志保留时长', '12', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '登录日志保留时长', '12', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '访问日志保留时长', '1', 0);
-- 时长单位 天
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', 'Cookie保留时长', '7', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', 'IP地理位置接口', 'None', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '地理位置服务', '百度地图开放平台', 'BaiDuIPSvr', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '地理位置服务', '聚合地理位置', 'JuheIPSvr', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '地理位置服务', '百度138地理位置', 'BaiDuIP138Svr', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '地理位置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj'||CHR(38)||'ip=', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '地理位置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206'||CHR(38)||'ip=', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '地理位置', 'BaiDuIP138Svr', 'https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=6006&query=', 0);
-- 时长单位 分钟
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', 'IP请求缓存时长', '10', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '演示系统', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '网站设置', '授权盐值', 'yjglE2eddCGcS7tTFTDd2DfvqXHgCnMhNhpmx9HJaC9l8GAZ', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '网站设置', '哈希结果', '6jTT50HGuk8V+AIsiE4IfqjcER71PBN1DY7gqOLZE7E=', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '默认应用程序', '0', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) Values (SEQ_DICTS_ID.NEXTVAL, '网站设置', '后台地址', 'http://localhost:50852', 0);
-- 系统登录首页设置
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '系统首页', '高仿码云', 'Login-Gitee', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '系统首页', '蓝色清新', 'Login-Blue', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '系统首页', '系统默认', 'Login', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '系统首页', '科技动感', 'Login-Tec', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '系统首页', 'Admin-LTE', 'Login-LTE', 0);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '网站设置', '登录界面', 'Login', 0);
DELETE FROM Navigations Where Category = '0';
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL, 0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL, 0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '保存密码', 20, 'fa fa-fa', 'savePassword', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '保存应用', 30, 'fa fa-fa', 'saveApp', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, '保存样式', 40, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 5, '保存头像', 50, 'fa fa-fa', 'saveIcon', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 6, '保存网站设置', 60, 'fa fa-fa', 'saveUISettings', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '系统锁屏', 25, 'fa fa-television', '~/Account/Lock', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '返回前台', 30, 'fa fa-hand-o-left', '~/Home/Index', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '网站设置', 40, 'fa fa-fa', '~/Admin/Settings', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '保存系统名称', 10, 'fa fa-fa', 'saveTitle', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '保存页脚设置', 20, 'fa fa-fa', 'saveFooter', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 5, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 6, '登录设置', 60, 'fa fa-fa', 'loginSettings', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 7, '自动锁屏', 70, 'fa fa-fa', 'lockScreen', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 8, '默认应用', 80, 'fa fa-fa', 'defaultApp', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '侧边栏', 55, 'fa fa-fa', '~/Admin/Sidebar', '0', 1);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, '分配部门', 40, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 5, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '角色管理', 70, 'fa fa-sitemap', '~/Admin/Roles', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 5, '分配部门', 50, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 6, '分配菜单', 60, 'fa fa-fa', 'assignMenu', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 7, '分配应用', 70, 'fa fa-fa', 'assignApp', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '部门管理', 80, 'fa fa-bank', '~/Admin/Groups', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 5, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '字典表维护', 90, 'fa fa-book', '~/Admin/Dicts', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '暂停', 10, 'fa fa-fa', 'pause', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '日志', 20, 'fa fa-fa', 'info', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '系统日志', 130, 'fa fa-gears', '#', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '登录日志', 20, 'fa fa-user-circle-o', '~/Admin/Logins', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 4, 'SQL日志', 40, 'fa fa-database', '~/Admin/SQL', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '网站分析', 145, 'fa fa-line-chart', '~/Admin/Analyse', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, IsResource) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL, '服务器日志', 10, 'fa fa-fa', 'log', '0', 2);
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '健康检查', 155, 'fa fa-heartbeat', '~/Admin/Healths', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL,0, '工具集合', 160, 'fa fa-gavel', '#', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '客户端测试', 10, 'fa fa-wrench', '~/Admin/Mobile', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, 'API文档', 20, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 3, '图标集', 30, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
-- 控件集合菜单
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAL, 0, '控件集合', 170, 'fa fa-stethoscope', '#', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 1, '行为式验证码', 10, 'fa fa-wrench', 'https://gitee.com/LongbowEnterprise/SliderCaptcha', '0');
INSERT INTO Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category) Values (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL - 2, '下拉框', 20, 'fa fa-bars', 'http://longbowenterprise.gitee.io/longbow-select/', '0');
DELETE FROM GROUPS WHERE GroupName = 'Admin';
INSERT INTO Groups (Id, GroupCode, GroupName, Description) VALUES (SEQ_GROUPS_ID.NEXTVAL, '001', 'Admin', '系统默认组');
DELETE FROM Roles where RoleName in ('Administrators', 'Default');
INSERT INTO Roles (Id, RoleName, Description) VALUES (SEQ_ROLES_ID.NEXTVAL, 'Administrators', '系统管理员');
INSERT INTO Roles (Id, RoleName, Description) VALUES (SEQ_ROLES_ID.NEXTVAL, 'Default', '默认用户,可访问前台页面');
DELETE FROM RoleGroup;
INSERT INTO RoleGroup (Id, GroupId, RoleId) SELECT SEQ_ROLEGROUP_ID.NEXTVAL, g.Id, r.Id From Groups g left join Roles r on 1=1 where GroupName = 'Admin' and RoleName = 'Administrators';
DELETE FROM UserGroup;
DELETE FROM UserRole;
INSERT INTO UserRole (Id, UserId, RoleId) SELECT SEQ_USERROLE_ID.NEXTVAL, u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'Admin' and RoleName = 'Administrators';
INSERT INTO UserRole (Id, UserId, RoleId) SELECT SEQ_USERROLE_ID.NEXTVAL, u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'User' and RoleName = 'Default';
DELETE FROM NavigationRole;
INSERT INTO NavigationRole (Id, NavigationID, RoleID) SELECT SEQ_NAVIGATIONROLE_ID.NEXTVAL, n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Administrators';
INSERT INTO NavigationRole (Id, NavigationID, RoleID) SELECT SEQ_NAVIGATIONROLE_ID.NEXTVAL, n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Default' and Name in ('后台管理', '个人中心', '返回前台', '通知管理');
INSERT INTO NavigationRole (Id, NavigationID, RoleID) SELECT SEQ_NAVIGATIONROLE_ID.NEXTVAL, n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Default' and ParentId in (select id from Navigations where Name in ('个人中心'));
-- Client Data
Delete From Dicts Where Category = '应用程序' and Code = 'Demo';
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '应用程序', '测试平台', 'Demo', 0);
Delete From Dicts Where Category = '应用首页' and Name = 'Demo';
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '应用首页', 'Demo', 'http://localhost:49185', 0);
Delete From Dicts Where Category = '测试平台';
Insert into Dicts (Id, Category, Name, Code, Define) values (SEQ_DICTS_ID.NEXTVAL, '测试平台', '网站标题', '前台演示系统', 1);
Insert into Dicts (Id, Category, Name, Code, Define) values (SEQ_DICTS_ID.NEXTVAL, '测试平台', '网站页脚', '前台演示程序后台权限管理框架', 1);
Insert into Dicts (Id, Category, Name, Code, Define) values (SEQ_DICTS_ID.NEXTVAL, '测试平台', '个人中心地址', '/Admin/Profiles', 1);
Insert into Dicts (Id, Category, Name, Code, Define) values (SEQ_DICTS_ID.NEXTVAL, '测试平台', '系统设置地址', '/Admin/Index', 1);
Insert into Dicts (Id, Category, Name, Code, Define) values (SEQ_DICTS_ID.NEXTVAL, '测试平台', '系统通知地址', '/Admin/Notifications', 1);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '测试平台', 'favicon', '/favicon.ico', 1);
INSERT INTO Dicts (Id, Category, Name, Code, Define) VALUES (SEQ_DICTS_ID.NEXTVAL, '测试平台', '网站图标', '/favicon.png', 1);
Delete from Navigations where Application = 'Demo';
INSERT into Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, Application) VALUES (SEQ_NAVIGATIONS_ID.NEXTVAl, 0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 'Demo');
INSERT into Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, Application) VALUES (SEQ_NAVIGATIONS_ID.NEXTVAl, 0, '测试页面', 20, 'fa fa-fa', '#', '1', 'Demo');
INSERT into Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, Application) VALUES (SEQ_NAVIGATIONS_ID.NEXTVAl, SEQ_NAVIGATIONS_ID.CURRVAL, '关于', 10, 'fa fa-fa', '~/Home/About', '1', 'Demo');
INSERT into Navigations (Id, ParentId, Name, "ORDER", Icon, Url, Category, Application) VALUES (SEQ_NAVIGATIONS_ID.NEXTVAl, 0, '返回码云', 20, 'fa fa-fa', 'https://gitee.com/LongbowEnterprise/BootstrapAdmin', '1', 'Demo');
-- 菜单授权
INSERT INTO NavigationRole (Id, NavigationId, RoleId) SELECT SEQ_NAVIGATIONROLE_ID.NEXTVAL, n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Default' and Application = 'Demo';
-- 角色对应用授权
DELETE From RoleApp where AppId in ('Demo', 'BA');
INSERT INTO RoleApp (Id, AppId, RoleId) SELECT SEQ_ROLEAPP_ID.NEXTVAL, 'Demo', ID From Roles Where RoleName = 'Default';
INSERT INTO RoleApp (Id, AppId, RoleId) SELECT SEQ_ROLEAPP_ID.NEXTVAL, 'BA', ID From Roles Where RoleName = 'Default';

View File

@ -1,215 +0,0 @@
CREATE TABLE Users (
ID INTEGER NOT NULL,
UserName NVARCHAR2 (16) NOT NULL,
Password NVARCHAR2 (50) NOT NULL,
PassSalt NVARCHAR2 (50) NOT NULL,
DisplayName NVARCHAR2 (50) NOT NULL,
RegisterTime DATE NOT NULL,
ApprovedTime DATE,
ApprovedBy NVARCHAR2 (50),
Description NVARCHAR2 (500) NOT NULL,
RejectedBy NVARCHAR2 (50) ,
RejectedTime DATE,
RejectedReason NVARCHAR2 (50),
Icon NVARCHAR2 (50),
Css NVARCHAR2 (50),
App NVARCHAR2 (50)
);
CREATE TABLE UserRole (
ID INTEGER NOT NULL,
UserID INTEGER NOT NULL,
RoleID INTEGER NOT NULL
);
CREATE TABLE UserGroup(
ID INTEGER NOT NULL,
UserID INTEGER NOT NULL,
GroupID INTEGER NOT NULL
);
CREATE TABLE Roles(
ID INTEGER NOT NULL,
RoleName NVARCHAR2 (50) NOT NULL,
Description NVARCHAR2 (500) NULL
);
CREATE TABLE RoleGroup(
ID INTEGER NOT NULL,
RoleID INTEGER NOT NULL,
GroupID INTEGER NOT NULL
);
CREATE TABLE RoleApp(
ID INTEGER NOT NULL,
AppID NVARCHAR2 (50) NOT NULL,
RoleID INTEGER NOT NULL
);
CREATE TABLE Notifications(
ID INTEGER NOT NULL,
Category NVARCHAR2 (50) NOT NULL,
Title NVARCHAR2 (50) NOT NULL,
Content NVARCHAR2 (50) NOT NULL,
RegisterTime DATE NOT NULL,
ProcessTime DATE NULL,
ProcessBy NVARCHAR2 (50) NULL,
ProcessResult NVARCHAR2 (50) NULL,
Status NVARCHAR2 (50) DEFAULT 0
);
CREATE TABLE Navigations(
ID INTEGER NOT NULL,
ParentId INTEGER DEFAULT 0,
Name NVARCHAR2 (50) NOT NULL,
"ORDER" INTEGER DEFAULT 0 NOT NULL,
Icon NVARCHAR2 (50) DEFAULT 'fa fa-fa',
Url NVARCHAR2 (2000) NULL,
Category NVARCHAR2 (50) DEFAULT 0,
Target NVARCHAR2 (10) DEFAULT '_self',
IsResource INTEGER DEFAULT 0,
Application NVARCHAR2 (200) DEFAULT 'BA'
);
CREATE TABLE NavigationRole(
ID INTEGER NOT NULL,
NavigationID INTEGER NOT NULL,
RoleID INTEGER NOT NULL
);
CREATE TABLE Logs(
ID INTEGER NOT NULL,
CRUD NVARCHAR2 (50) NOT NULL,
UserName NVARCHAR2 (50) NOT NULL,
LogTime DATE NOT NULL,
Ip NVARCHAR2 (15) NOT NULL,
Browser NVARCHAR2 (50) NULL,
OS NVARCHAR2 (50) NULL,
City NVARCHAR2 (50) NULL,
RequestUrl NVARCHAR2 (500) NOT NULL,
RequestData NVARCHAR2 (2000) NULL,
UserAgent NVARCHAR2 (2000) NULL,
Referer NVARCHAR2 (2000) NULL
);
CREATE TABLE Groups(
ID INTEGER NOT NULL,
GroupCode NVARCHAR2 (50) NOT NULL,
GroupName NVARCHAR2 (50) NOT NULL,
Description NVARCHAR2 (500) NULL
);
CREATE TABLE Exceptions(
ID INTEGER NOT NULL,
AppDomainName NVARCHAR2 (50) NOT NULL,
ErrorPage NVARCHAR2 (50) NOT NULL,
UserID NVARCHAR2 (50) NULL,
UserIp NVARCHAR2 (15) NULL,
ExceptionType NVARCHAR2 (2000) NOT NULL,
Message NVARCHAR2 (2000) NOT NULL,
StackTrace NVARCHAR2 (2000) NULL,
LogTime DATE NOT NULL,
Category NVARCHAR2 (50) NULL
);
CREATE TABLE Dicts(
ID INTEGER NOT NULL,
Category NVARCHAR2 (50) NOT NULL,
Name NVARCHAR2 (50) NOT NULL,
Code NVARCHAR2 (2000) NOT NULL,
Define INTEGER DEFAULT 1 NOT NULL
);
CREATE TABLE Messages(
ID INTEGER NOT NULL,
Title NVARCHAR2 (50) NOT NULL,
Content NVARCHAR2 (500) NOT NULL,
"FROM" NVARCHAR2 (50) NOT NULL,
"TO" NVARCHAR2 (50) NOT NULL,
SendTime DATE NOT NULL,
Status NVARCHAR2 (50) NOT NULL,
Flag INTEGER DEFAULT 0,
IsDelete INTEGER DEFAULT 0,
Label NVARCHAR2 (50)
);
CREATE TABLE Tasks(
ID INTEGER NOT NULL,
TaskName NVARCHAR2 (500) NOT NULL,
AssignName NVARCHAR2 (50) NOT NULL,
UserName NVARCHAR2 (50) NOT NULL,
TaskTime INTEGER NOT NULL,
TaskProgress INTEGER NOT NULL,
AssignTime DATE NOT NULL
);
CREATE TABLE RejectUsers(
ID INTEGER NOT NULL,
UserName NVARCHAR2 (50) NOT NULL,
DisplayName NVARCHAR2 (50) NOT NULL,
RegisterTime DATE NOT NULL,
RejectedBy NVARCHAR2 (50) NOT NULL,
RejectedTime DATE NOT NULL,
RejectedReason NVARCHAR2 (50) NULL
);
CREATE TABLE LoginLogs(
ID INTEGER NOT NULL,
UserName NVARCHAR2 (50) NOT NULL,
LoginTime DATE NOT NULL,
Ip NVARCHAR2 (15) NOT NULL,
OS NVARCHAR2 (50) NULL,
Browser NVARCHAR2 (50) NULL,
City NVARCHAR2 (50) NULL,
Result NVARCHAR2 (50) NOT NULL,
UserAgent NVARCHAR2 (2000) NULL
);
CREATE TABLE ResetUsers(
ID INTEGER NOT NULL,
UserName NVARCHAR2 (50) NOT NULL,
DisplayName NVARCHAR2 (50) NOT NULL,
Reason NVARCHAR2 (500) NOT NULL,
ResetTime DATE NOT NULL
);
CREATE TABLE Traces(
ID INTEGER NOT NULL,
UserName NVARCHAR2 (50) NOT NULL,
LogTime DATE NOT NULL,
IP NVARCHAR2 (15) NOT NULL,
Browser NVARCHAR2 (2000),
OS NVARCHAR2 (2000),
City NVARCHAR2 (50),
RequestUrl NVARCHAR2 (2000) NOT NULL,
UserAgent NVARCHAR2 (2000),
Referer NVARCHAR2 (2000)
);
CREATE TABLE DBLogs (
ID INTEGER NOT NULL,
UserName NVARCHAR2 (50),
SQL NVARCHAR2 (2000) NOT NULL,
LogTime DATE NOT NULL
);
CREATE SEQUENCE SEQ_USERS_ID;
CREATE SEQUENCE SEQ_USERROLE_ID;
CREATE SEQUENCE SEQ_USERGROUP_ID;
CREATE SEQUENCE SEQ_ROLES_ID;
CREATE SEQUENCE SEQ_ROLEGROUP_ID;
CREATE SEQUENCE SEQ_ROLEAPP_ID;
CREATE SEQUENCE SEQ_NOTIFICATIONS_ID;
CREATE SEQUENCE SEQ_NAVIGATIONS_ID;
CREATE SEQUENCE SEQ_NAVIGATIONROLE_ID;
CREATE SEQUENCE SEQ_LOGS_ID;
CREATE SEQUENCE SEQ_GROUPS_ID;
CREATE SEQUENCE SEQ_EXCEPTIONS_ID;
CREATE SEQUENCE SEQ_DICTS_ID;
CREATE SEQUENCE SEQ_MESSAGES_ID;
CREATE SEQUENCE SEQ_TASKS_ID;
CREATE SEQUENCE SEQ_REJECTUSERS_ID;
CREATE SEQUENCE SEQ_LOGINLOGS_ID;
CREATE SEQUENCE SEQ_RESETUSERS_ID;
CREATE SEQUENCE SEQ_TRACES_ID;
CREATE SEQUENCE SEQ_DBLOGS_ID;

View File

@ -7,7 +7,7 @@ INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, Appr
DELETE From Dicts Where Define = 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 ('应用程序', '未设置', '', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '未设置', '0', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '网站标题', '后台管理系统', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '网站页脚', '2016 © 通用后台管理系统', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统通知', '用户注册', '0', 0);
@ -26,13 +26,12 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('头像地址', '头像
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', '蓝色样式', 'blue.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', '黑色样式', 'black.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', 'AdminLTE', 'lte.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '使用样式', 'blue.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('当前样式', '使用样式', 'blue.css', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '前台首页', '~/Home/Index', 0);
-- 网站UI设置
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 ('网站设置', '短信验证码登录', '1', 0);
@ -43,23 +42,21 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '自动
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);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '登录日志保留时长', '12', 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 ('系统设置', '操作日志保留时长', '12', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '登录日志保留时长', '12', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '访问日志保留时长', '1', 0);
-- 时长单位 天
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'Cookie保留时长', '7', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'IP地理位置接口', 'None', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('地理位置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '演示系统', '0', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'Cookie保留时长', '7', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'IP地理位置接口', 'None', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '演示系统', '0', 0);
-- 时长单位 分钟
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', 'IP请求缓存时长', '10', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'IP请求缓存时长', '10', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
DELETE FROM Navigations Where Category = '0';
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
@ -87,7 +84,6 @@ 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', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, '侧边栏', 55, 'fa fa-fa', '~/Admin/Sidebar', '0', 1);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '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);
@ -114,8 +110,6 @@ 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', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '暂停', 10, 'fa fa-fa', 'pause', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '日志', 20, 'fa fa-fa', 'info', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '系统日志', 130, 'fa fa-gears', '#', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 1, 0, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
@ -164,8 +158,6 @@ Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '个人中心地址', 'http://localhost:50852/Admin/Profiles', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统设置地址', 'http://localhost:50852/Admin/Index', 1);
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统通知地址', 'http://localhost:50852/Admin/Notifications', 1);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', 'favicon', 'http://localhost:49185/favicon.ico', 1);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', '网站图标', 'http://localhost:49185/favicon.png', 1);
Delete from Navigations where Application = '2';
INSERT into Navigations (ParentId, Name, "order", Icon, Url, Category, Application) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);

View File

@ -88,8 +88,7 @@ CREATE TABLE Logs(
City VARCHAR (50) NULL,
RequestUrl VARCHAR (500) NOT NULL,
RequestData TEXT NULL,
UserAgent VARCHAR (2000) NULL,
Referer VARCHAR (2000)
UserAgent VARCHAR (2000) NULL
);
CREATE TABLE Groups(
@ -143,6 +142,16 @@ CREATE TABLE Tasks(
AssignTime DATE NOT NULL
);
CREATE TABLE RejectUsers(
ID SERIAL PRIMARY KEY,
UserName VARCHAR (50) NOT NULL,
DisplayName VARCHAR (50) NOT NULL,
RegisterTime DATE NOT NULL,
RejectedBy VARCHAR (50) NOT NULL,
RejectedTime DATE NOT NULL,
RejectedReason VARCHAR (50) NULL
);
CREATE TABLE RejectUsers(
ID SERIAL PRIMARY KEY,
UserName VARCHAR (50) NOT NULL,
@ -168,12 +177,11 @@ CREATE TABLE Traces(
UserName VARCHAR (50) NOT NULL,
LogTime DATE NOT NULL,
IP VARCHAR (15) NOT NULL,
Browser VARCHAR (2000),
OS VARCHAR (2000),
Browser VARCHAR (50),
OS VARCHAR (50),
City VARCHAR (50),
RequestUrl VARCHAR (2000) NOT NULL,
UserAgent VARCHAR (2000) NULL,
Referer VARCHAR (2000)
RequestUrl VARCHAR (500) NOT NULL,
UserAgent VARCHAR (2000) NULL
);
CREATE TABLE DBLogs (

View File

@ -2,10 +2,12 @@
-- User/123789
DELETE From Users where UserName in ('Admin', 'User');
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description]) values ('Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', datetime(CURRENT_TIMESTAMP, 'localtime'), datetime(CURRENT_TIMESTAMP, 'localtime'), 'system', '系统默认创建');
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description], [App]) values ('User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', '测试账号', datetime(CURRENT_TIMESTAMP, 'localtime'), datetime(CURRENT_TIMESTAMP, 'localtime'), 'system', '系统默认创建', 'Demo');
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description], [App]) values ('User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', '测试账号', datetime(CURRENT_TIMESTAMP, 'localtime'), datetime(CURRENT_TIMESTAMP, 'localtime'), 'system', '系统默认创建', '2');
DELETE From Dicts Where Define = 0;
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用程序', '后台管理', 'BA', 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 ('应用程序', '未设置', '0', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '网站标题', '后台管理系统', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '网站页脚', '2016 © 通用后台管理系统', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统通知', '用户注册', '0', 0);
@ -24,13 +26,12 @@ INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('头像地址
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站样式', '蓝色样式', 'blue.css', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站样式', '黑色样式', 'black.css', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站样式', 'AdminLTE', 'lte.css', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '使用样式', 'blue.css', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('当前样式', '使用样式', 'blue.css', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '前台首页', '~/Home/Index', 0);
-- 网站UI设置
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 ('网站设置', '短信验证码登录', '1', 0);
@ -40,53 +41,22 @@ INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '自动锁屏时长', '30', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '自动锁屏', '0', 0);
-- 是否启用 Blazor 默认为 0 未启用
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', 'Blazor', '0', 0);
-- 是否启用 健康检查 默认为 0 未启用 1 启用
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 ('网站设置', '操作日志保留时长', '12', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '登录日志保留时长', '12', 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 ('系统设置', '操作日志保留时长', '12', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', '登录日志保留时长', '12', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', '访问日志保留时长', '1', 0);
-- 时长单位 天
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', 'Cookie保留时长', '7', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', 'IP地理位置接口', 'None', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('地理位置服务', '百度地图开放平台', 'BaiDuIPSvr', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('地理位置服务', '聚合地理位置', 'JuheIPSvr', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('地理位置服务', '百度138地理位置', 'BaiDuIP138Svr', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('地理位置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('地理位置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('地理位置', 'BaiDuIP138Svr', 'https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=6006&query=', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', 'Cookie保留时长', '7', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', 'IP地理位置接口', 'None', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', 'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', 'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0);
-- 时长单位 分钟
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', 'IP请求缓存时长', '10', 0);
-- 演示系统
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '演示系统', '0', 0);
-- 授权密码默认为 123789
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '授权盐值', 'yjglE2eddCGcS7tTFTDd2DfvqXHgCnMhNhpmx9HJaC9l8GAZ', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '哈希结果', '6jTT50HGuk8V+AIsiE4IfqjcER71PBN1DY7gqOLZE7E=', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '默认应用程序', '0', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '后台地址', 'http://localhost:50852', 0);
-- 系统登录首页设置
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统首页', '2-高仿码云', 'Login-Gitee', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统首页', '3-蓝色清新', 'Login-Blue', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统首页', '1-系统默认', 'Login', 1);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', '科技动感', '4-Login-Tec', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统首页', 'Admin-LTE', '5-Login-LTE', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('网站设置', '登录界面', 'Login', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', 'IP请求缓存时长', '10', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', '演示系统', '0', 0);
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置', '验证码图床', 'http://imgs.sdgxgz.com/images/', 0);
DELETE FROM Navigations Where Category = '0';
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
@ -107,14 +77,12 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
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], IsResource) VALUES (last_insert_rowid() - 7, '默认应用', 80, 'fa fa-fa', 'defaultApp', '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);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, '侧边栏', 55, 'fa fa-fa', '~/Admin/Sidebar', '0', 1);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '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);
@ -141,8 +109,6 @@ 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', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '暂停', 10, 'fa fa-fa', 'pause', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '日志', 20, 'fa fa-fa', 'info', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '系统日志', 130, 'fa fa-gears', '#', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid(), '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
@ -172,46 +138,44 @@ INSERT INTO [Roles] ([RoleName], [Description]) VALUES ('Administrators', '系
INSERT INTO [Roles] ([RoleName], [Description]) VALUES ('Default', '默认用户,可访问前台页面');
DELETE FROM RoleGroup;
INSERT INTO RoleGroup (GroupId, RoleId) SELECT g.Id, r.Id From Groups g left join Roles r on 1=1 where GroupName = 'Admin' and RoleName = 'Administrators';
INSERT INTO RoleGroup (GroupId, RoleId) SELECT g.Id, r.Id From Groups g left join Roles r where GroupName = 'Admin' and RoleName = 'Administrators';
DELETE FROM UserGroup;
DELETE FROM UserRole;
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'Admin' and RoleName = 'Administrators';
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r on 1=1 where UserName = 'User' and RoleName = 'Default';
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r where UserName = 'Admin' and RoleName = 'Administrators';
INSERT INTO UserRole (UserId, RoleId) SELECT u.Id, r.Id From Users u left join Roles r where UserName = 'User' and RoleName = 'Default';
DELETE FROM NavigationRole;
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Administrators';
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Default' and Name in ('后台管理', '个人中心', '返回前台', '通知管理');
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 Where RoleName = 'Default' and ParentId in (select id from Navigations where Name in ('个人中心'));
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r Where RoleName = 'Administrators';
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r Where RoleName = 'Default' and Name in ('后台管理', '个人中心', '返回前台', '通知管理');
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r Where RoleName = 'Default' and ParentId in (select id from Navigations where Name in ('个人中心'));
-- Client Data
Delete From [Dicts] Where Category = '应用程序' and Code = 'Demo';
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用程序', '测试平台', 'Demo', 0);
Delete From [Dicts] Where Category = '应用首页' and Name = 'Demo';
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用首页', 'Demo', 'http://localhost:49185', 0);
Delete From [Dicts] Where Category = '应用程序' and Code = 2;
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用程序', '测试平台', 2, 0);
Delete From [Dicts] Where Category = '应用首页' and Name = 2;
INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用首页', 2, 'http://localhost:49185/', 0);
Delete From [Dicts] Where Category = '测试平台';
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '网站标题', '前台演示系统', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '网站页脚', '前台演示程序后台权限管理框架', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '个人中心地址', '/Admin/Profiles', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '系统设置地址', '/Admin/Index', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '系统通知地址', '/Admin/Notifications', 1);
INSERT INTO Dicts (Category, [Name], Code, Define) VALUES ('测试平台', 'favicon', '/favicon.ico', 1);
INSERT INTO Dicts (Category, [Name], Code, Define) VALUES ('测试平台', '网站图标', '/favicon.png', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '网站页脚', '通用后台管理测试平台', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '个人中心地址', 'http://localhost:50852/Admin/Profiles', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '系统设置地址', 'http://localhost:50852/Admin/Index', 1);
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '系统通知地址', 'http://localhost:50852/Admin/Notifications', 1);
Delete from [Navigations] where Application = 'Demo';
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 'Demo');
Delete from [Navigations] where Application = 2;
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '测试页面', 20, 'fa fa-fa', '#', '1', 'Demo');
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (last_insert_rowid(), '关于', 10, 'fa fa-fa', '~/Home/About', '1', 'Demo');
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '测试页面', 20, 'fa fa-fa', '#', '1', 2);
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (last_insert_rowid(), '关于', 10, 'fa fa-fa', '~/Home/About', '1', 2);
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '返回码云', 20, 'fa fa-fa', 'https://gitee.com/LongbowEnterprise/BootstrapAdmin', '1', 'Demo');
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '返回码云', 20, 'fa fa-fa', 'https://gitee.com/LongbowEnterprise/BootstrapAdmin', '1', 2);
-- 菜单授权
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Default' and [Application] = 'Demo';
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r Where r.RoleName = 'Administrators' and [Application] = 2;
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r Where r.RoleName = 'Default' and [Application] = 2;
-- 角色对应用授权
DELETE From RoleApp where AppId in ('Demo', 'BA');
INSERT INTO RoleApp (AppId, RoleId) SELECT 'Demo', ID From Roles Where RoleName = 'Default';
INSERT INTO RoleApp (AppId, RoleId) SELECT 'BA', ID From Roles Where RoleName = 'Default';
DELETE From RoleApp where AppId = '2';
INSERT INTO RoleApp (AppId, RoleId) SELECT '2', ID From Roles Where RoleName = 'Default';

View File

@ -63,12 +63,12 @@ CREATE TABLE Navigations(
ParentId INT DEFAULT (0),
Name VARCHAR (50) NOT NULL,
[Order] INT NOT NULL DEFAULT (0),
Icon VARCHAR (50) DEFAULT [fa fa-fa],
Icon VARCHAR (50) DEFAULT none,
Url VARCHAR (4000) NULL,
Category VARCHAR (50) DEFAULT 0,
Target VARCHAR (10) DEFAULT [_self],
Target VARCHAR (10) DEFAULT _self,
IsResource INT DEFAULT (0),
Application VARCHAR (200) DEFAULT [BA] COLLATE NOCASE
Application VARCHAR (200) DEFAULT (0)
);
CREATE TABLE NavigationRole(
@ -88,8 +88,7 @@ CREATE TABLE Logs(
City VARCHAR (50) NULL,
RequestUrl VARCHAR (500) NOT NULL,
RequestData TEXT NULL,
UserAgent VARCHAR (2000) NULL,
Referer VARCHAR (2000)
UserAgent VARCHAR (2000) NULL
);
CREATE TABLE Groups(
@ -178,12 +177,11 @@ CREATE TABLE Traces(
UserName VARCHAR (50) NOT NULL COLLATE NOCASE,
LogTime DATETIME NOT NULL,
IP VARCHAR (15) NOT NULL,
Browser VARCHAR (2000),
OS VARCHAR (2000),
Browser VARCHAR (50),
OS VARCHAR (50),
City VARCHAR (50),
RequestUrl VARCHAR (2000) NOT NULL,
UserAgent VARCHAR (2000),
Referer VARCHAR (2000)
RequestUrl VARCHAR (500) NOT NULL,
UserAgent VARCHAR (2000)
);
CREATE TABLE DBLogs (

View File

@ -5,12 +5,12 @@ GO
-- User/123789
DELETE From Users where UserName in ('Admin', 'User')
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description]) values ('Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', GetDate(), GetDate(), 'system', N'系统默认创建')
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description], App) values ('User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', N'测试账号', GetDate(), GetDate(), 'system', N'系统默认创建', 'Demo')
INSERT INTO Users (UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description], App) values ('User', 'tXG/yNffpnm6cThrCH7wf6jN1ic3VHvLoY4OrzKtrZ4=', 'c5cIrRMn8XjB84M/D/X7Lg9uUqQFmYNEdxb/4HWH8OLa4pNZ', N'测试账号', GetDate(), GetDate(), 'system', N'系统默认创建', '2')
DELETE From Dicts Where Define = 0
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'菜单', N'系统菜单', N'0', 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'BA', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'应用程序', N'未设置', N'0', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'网站标题', N'后台管理系统', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'网站页脚', N'2016 © 通用后台管理系统', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统通知', N'用户注册', N'0', 0)
@ -29,13 +29,12 @@ INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'头像地
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站样式', N'蓝色样式', N'blue.css', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站样式', N'黑色样式', N'black.css', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站样式', N'AdminLTE', N'lte.css', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'使用样式', N'blue.css', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'当前样式', N'使用样式', N'blue.css', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'前台首页', N'~/Home/Index', 0)
-- 网站UI设置
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'短信验证码登录', N'1', 0)
@ -45,50 +44,22 @@ INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设
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)
-- 是否启用 Blazor 默认为 0 未启用
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'Blazor', N'0', 0)
-- 是否启用 健康检查 默认为 0 未启用 1 启用
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'健康检查', N'1', 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)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'登录日志保留时长', '12', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'访问日志保留时长', '1', 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)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'登录日志保留时长', '12', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'访问日志保留时长', '1', 0)
-- 时长单位 天
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'Cookie保留时长', '7', 0)
-- 地理位置接口
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'IP地理位置接口', 'None', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'地理位置服务', N'百度地图开放平台', 'BaiDuIPSvr', 0);
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'地理位置服务', N'聚合地理位置', 'JuheIPSvr', 0);
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'地理位置服务', N'百度138地理位置', 'BaiDuIP138Svr', 0);
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'地理位置', N'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'地理位置', N'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'地理位置', N'BaiDuIP138Svr', 'https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?resource_id=6006&query=', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'Cookie保留时长', '7', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'IP地理位置接口', 'None', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'BaiDuIPSvr', 'http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0)
-- 时长单位 分钟
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'IP请求缓存时长', '10', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'演示系统', '0', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'授权盐值', 'yjglE2eddCGcS7tTFTDd2DfvqXHgCnMhNhpmx9HJaC9l8GAZ', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'哈希结果', '6jTT50HGuk8V+AIsiE4IfqjcER71PBN1DY7gqOLZE7E=', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'验证码图床', 'http://imgs.sdgxgz.com/images/', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'默认应用程序', '0', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'网站设置', N'后台地址', 'http://localhost:50852', 0)
-- 系统登录首页设置
INSERT INTO Dicts (Category, Name, Code, Define) VALUES (N'系统首页', N'高仿码云', N'Login-Gitee', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES (N'系统首页', N'蓝色清新', N'Login-Blue', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES (N'系统首页', N'系统默认', N'Login', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES (N'系统首页', N'科技动感', N'Login-Tec', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES (N'系统首页', N'Admin-LTE', N'Login-LTE', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES (N'网站设置', N'登录界面', N'Login', 0);
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'IP请求缓存时长', '10', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'演示系统', '0', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'验证码图床', 'http://imgs.sdgxgz.com/images/', 0)
DELETE FROM Navigations Where Category = N'0'
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'后台管理', 10, N'fa fa-gear', N'~/Admin/Index', N'0')
@ -109,14 +80,12 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
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], IsResource) VALUES (@@Identity - 7, N'默认应用', 80, 'fa fa-fa', 'defaultApp', '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);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, N'图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, N'侧边栏', 55, 'fa fa-fa', '~/Admin/Sidebar', '0', 1);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'用户管理', 60, N'fa fa-user', N'~/Admin/Users', 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);
@ -143,8 +112,6 @@ 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', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'站内消息', 100, N'fa fa-envelope', N'~/Admin/Messages', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'任务管理', 110, N'fa fa fa-tasks', N'~/Admin/Tasks', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'暂停', 10, 'fa fa-fa', 'pause', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'日志', 20, 'fa fa-fa', 'info', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'通知管理', 120, N'fa fa-bell', N'~/Admin/Notifications', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'日志管理', 130, N'fa fa-gears', N'#', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity, N'操作日志', 10, N'fa fa-edit', N'~/Admin/Logs', N'0')
@ -187,24 +154,22 @@ INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigat
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT n.Id, r.Id FROM Navigations n left join Roles r on 1=1 where RoleName = 'Default' and ParentId in (select Id from Navigations where Name in (N'个人中心'))
-- Client Data
Declare @AppId nvarchar(50)
set @AppId = N'Demo'
declare @AppName nvarchar(50)
Declare @AppId nvarchar(1)
set @AppId = N'2'
declare @AppName nvarchar(8)
set @AppName = N'测试平台'
Delete From [dbo].[Dicts] Where Category = N'应用程序' and Code = @AppId
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'应用程序', @AppName, @AppId, 0)
Delete From [Dicts] Where Category = '应用首页' and Name = @AppId
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'应用首页', @AppId, 'http://localhost:49185', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'应用首页', @AppId, 'http://localhost:49185/', 0)
Delete From [dbo].[Dicts] Where Category = @AppName
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'网站标题', N'前台演示程序', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'网站页脚', N'前台演示程序后台权限管理框架', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'个人中心地址', N'/Admin/Profiles', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统设置地址', N'/Admin/Index', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统通知地址', N'/Admin/Notifications', 1);
INSERT Dicts (Category, Name, Code, Define) VALUES (@AppName, N'favicon', N'/favicon.ico', 1);
INSERT Dicts (Category, Name, Code, Define) VALUES (@AppName, N'网站图标', '/favicon.png', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'网站标题', N'托盘组垛程序', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'网站页脚', N'通用后台管理测试平台', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'个人中心地址', N'http://localhost:50852/Admin/Profiles', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统设置地址', N'http://localhost:50852/Admin/Index', 1);
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统通知地址', N'http://localhost:50852/Admin/Notifications', 1);
-- 菜单
DELETE FROM Navigations Where [Application] = @AppId
@ -215,9 +180,9 @@ INSERT [dbo].[Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Categor
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, N'返回码云', 20, 'fa fa-fa', 'https://gitee.com/LongbowEnterprise/BootstrapAdmin', '1', @AppId)
-- 菜单授权
INSERT INTO NavigationRole (NavigationId, RoleId) SELECT n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Administrators' and [Application] = @AppId;
INSERT INTO NavigationRole SELECT n.ID, r.ID FROM Navigations n left join Roles r on 1=1 Where r.RoleName = 'Default' and [Application] = @AppId
-- 角色对应用授权
DELETE From RoleApp where AppId = @AppId;
INSERT INTO RoleApp (AppId, RoleId) SELECT @AppId, ID From Roles Where RoleName = 'Default'
INSERT INTO RoleApp (AppId, RoleId) SELECT 'BA', ID From Roles Where RoleName = 'Default'

View File

@ -240,7 +240,7 @@ GO
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_IsResource] DEFAULT ((0)) FOR [IsResource]
GO
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Application] DEFAULT (N'BA') FOR [Application]
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Application] DEFAULT ((0)) FOR [Application]
GO
ALTER TABLE [dbo].[Navigations] ADD CONSTRAINT [DF_Navigations_Target] DEFAULT ('_self') FOR [Target]
@ -282,7 +282,6 @@ CREATE TABLE [dbo].[Logs](
[RequestUrl] [nvarchar](500) NOT NULL,
[RequestData] [nvarchar](max) NULL,
[UserAgent] [varchar](2000) NULL,
[Referer] [varchar](2000) NULL,
CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED
(
[ID] ASC
@ -564,12 +563,11 @@ CREATE TABLE [dbo].[Traces](
[UserName] [varchar](50) NOT NULL,
[LogTime] [datetime] NOT NULL,
[Ip] [varchar](15) NOT NULL,
[Browser] [varchar](2000) NULL,
[OS] [varchar](2000) NULL,
[Browser] [varchar](50) NULL,
[OS] [varchar](50) NULL,
[City] [nvarchar](50) NULL,
[RequestUrl] [nvarchar](2000) NOT NULL,
[RequestUrl] [nvarchar](500) NOT NULL,
[UserAgent] [varchar](2000) NULL,
[Referer] [nvarchar](2000) NULL,
CONSTRAINT [PK_Traces] PRIMARY KEY CLUSTERED
(
[ID] ASC

View File

@ -1,9 +1,5 @@
# init sqlserver database
$startPath = $args[0]
if ($startPath -eq $null) {
$startPath = "Z:\src\Longbow\BootstrapAdmin\db\SqlServer"
}
$startPath = "Z:\src\Longbow\BootstrapAdmin\DatabaseScripts\SqlServer"
$sqlInstance = "localhost"
$outFile = join-path $startPath "output.log"
$sqlFile = join-path $startPath "Install.sql"

View File

@ -4,10 +4,8 @@ cd ~/BootstrapAdmin
git pull
dotnet publish src/admin/Bootstrap.Admin -c Release
rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/net5.0/publish/appsettings*.json
rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/net5.0/publish/BootstrapAdmin.db
rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp2.2/publish/appsettings*.json
systemctl stop ba.admin
\cp -fr ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/net5.0/publish/* /usr/local/ba/admin/
\cp -fr ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/admin/
systemctl start ba.admin
systemctl status ba.admin -l
systemctl status ba.admin

View File

@ -4,8 +4,8 @@ cd ~/BootstrapAdmin
git pull
dotnet publish src/client/Bootstrap.Client -c Release
rm -f ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/net5.0/publish/appsettings*.json
rm -f ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/appsettings*.json
systemctl stop ba.client
\cp -fr ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/net5.0/publish/* /usr/local/ba/client/
\cp -fr ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/client/
systemctl start ba.client
systemctl status ba.client -l
systemctl status ba.client

View File

@ -1,13 +0,0 @@
# 显示 dotnet version
write-host "dotnet --version" -ForegroundColor Cyan
dotnet --version
# 注意 my.ini 文件行结束符必须为CRLF
$iniPath="C:\Program Files\MySQL\MySQL Server 5.7\my.ini"
write-host "copy $($env:appveyor_build_folder)\db\MySQL\my.ini -> $iniPath" -ForegroundColor Cyan
xcopy "$($env:appveyor_build_folder)\db\MySQL\my.ini" $iniPath /y
$newText = ([System.IO.File]::ReadAllText($iniPath)).Replace("\n", "\r\n")
[System.IO.File]::WriteAllText($iniPath, $newText)
write-host "starting database services ..." -ForegroundColor Cyan

View File

@ -1,42 +0,0 @@
fix(#BUGID): 简要描述
#Comment
comment #BUGID
#Issue
close link fix https://gitee.com/LongbowEnterprise/dashboard/issues?id=BUGID
# 样式 : feat(location): 接入登录API
#
# 登录功能与服务器对接
#
<type>(<scope>): <subject>
<body>
<footer>
#其中 type 的值可以有
# feat: 新功能
# fix: 修复bug
# doc: 文档改变
# style: 代码格式改变
# refactor: 某个已有功能重构
# perf: 性能优化
# test: 增加测试
# build: 改变了build工具 如 更新 props 文件
# revert: 撤销上一次的 commit
# db: 数据库文件或者脚本更改
# script: 辅助脚本改变
#
#scope: 用来说明此次修改的影响范围
# all: 表示影响面大 ,如修改了网络框架 会对真个程序产生影响
# location: 表示影响小,某个小小的功能
# module: 表示会影响某个模块 如登录模块、首页模块 、用户管理模块等等
#
#subject: 用来简要描述本次改动,概述就好了
#
#body: 具体的修改信息 应该尽量详细
#
#footer: 放置写备注啥的,如果是 bug 可以把bug id放入
#

View File

@ -1,32 +0,0 @@
## 提交模板配置
### Windows Fork
Windows 版本的 Fork 提供了提交模板 commit message template功能配置步骤如下
#### git 配置文件
1. 拷贝仓库 `scripts\git\commit_msg_template.txt` 文件到当前用户根目录下 `C:\Users\[用户名]\.commit_msg_template.txt`
2. 配置 git 全局配置文件 `C:\Users\[用户名]\.gitconfig` (此文件为隐藏文件)
3. 更新 commit 配置项
```log
[commit]
template = /Users/argo/.commit_msg_template.txt
```
注意原始文件不是 . 开头拷贝到跟目录下为 . 开头文件名(点号开头文件默认为隐藏文件)
#### Fork 配置步骤
1. 打开要配置的仓库
2. 点击菜单栏第二个 **仓库** 菜单Repository
3. 下拉菜单中选中最后一个菜单项 **仓库设置** 子菜单Settings for this repository
如下图所示
![输入图片说明](https://images.gitee.com/uploads/images/2020/0327/123310_1b9b4af3_554725.png "Screen Shot 2020-03-27 at 12.30.38.png")
4. 切换到 **提交模板** 面板Commit Template
5. 勾选使用 **全局配置文件** Use global git configuration file
下面的文本框内即出现提交模板内容

View File

@ -1,3 +0,0 @@
@echo off
copy commit_msg_template.txt "%USERPROFILE%\.commit_msg_template.txt" /y

View File

@ -1,3 +0,0 @@
#! /bin/bash
cp commit_msg_template.txt "../../.git/commit_msg_template1.txt"

View File

@ -1,14 +0,0 @@
#! /bin/bash
mkdir /usr/local/ba
mkdir /usr/local/ba/admin
mkdir /usr/local/ba/client
cp ~/BootstrapAdmin/src/admin/Bootstrap.Admin/appsettings.json /usr/local/ba/admin
cp ~/BootstrapAdmin/src/admin/Bootstrap.Admin/BootstrapAdmin.db /usr/local/ba/admin
cp ~/BootstrapAdmin/src/client/Bootstrap.Client/appsettings.json /usr/local/ba/client
cp ~/BootstrapAdmin/scripts/linux/services/* /usr/lib/systemd/system
systemctl enable ba.admin
systemctl enable ba.client
systemctl enable nginx

View File

@ -1,3 +0,0 @@
#! /bin/bash
dotnet publish src/admin/Bootstrap.Admin -c Release

View File

@ -1,3 +0,0 @@
#! /bin/bash
dotnet publish src/client/Bootstrap.Client -c Release

View File

@ -1,15 +0,0 @@
[Unit]
Description=Bootstrap Admin Application
[Service]
Type=simple
WorkingDirectory=/usr/local/ba/admin
Environment=ASPNETCORE_ENVIRONMENT=Production
ExecStart=/usr/bin/dotnet Bootstrap.Admin.dll --urls http://localhost:50852
ExecStop=/bin/kill -2 $MAINPID
KillMode=process
Restart=on-failure
RestartSec=1s
[Install]
WantedBy=multi-user.target

View File

@ -1,15 +0,0 @@
[Unit]
Description=Bootstrap Client Application
[Service]
Type=simple
WorkingDirectory=/usr/local/ba/client
Environment=ASPNETCORE_ENVIRONMENT=Production
ExecStart=/usr/bin/dotnet Bootstrap.Client.dll --urls http://localhost:49185
ExecStop=/bin/kill -2 $MAINPID
KillMode=process
Restart=on-failure
RestartSec=1s
[Install]
WantedBy=multi-user.target

View File

@ -1,16 +0,0 @@
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View File

@ -1,3 +0,0 @@
#! /bin/bash
dotnet watch --project ./src/admin/Bootstrap.Admin run

View File

@ -1,3 +0,0 @@
#! /bin/bash
dotnet watch --project ./src/client/Bootstrap.Client run

View File

@ -1,3 +0,0 @@
@echo off
dotnet watch --project ./src/admin/Bootstrap.Admin run

View File

@ -1,3 +0,0 @@
@echo off
dotnet watch --project ./src/client/Bootstrap.Client run

View File

@ -1,17 +0,0 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<PackageProjectUrl>https://gitee.com/LongbowEnterprise/BootstrapAdmin</PackageProjectUrl>
<RepositoryUrl>https://gitee.com/LongbowEnterprise/BootstrapAdmin.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<DocumentationFile>$(MSBuildProjectName).xml</DocumentationFile>
<DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.21" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.0" />
<PackageReference Include="Longbow.Configuration" Version="2.2.7" />
<PackageReference Include="Longbow.Tasks" Version="2.2.23" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Sentry.AspNetCore" Version="1.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Bootstrap.DataAccess\Bootstrap.DataAccess.csproj" />
</ItemGroup>
</Project>

View File

@ -1,25 +1,15 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Models;
using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using Bootstrap.Security.Mvc;
using Longbow.AlipayAuth;
using Longbow.GiteeAuth;
using Longbow.GitHubAuth;
using Longbow.TencentAuth;
using Longbow.Web.SMS;
using Longbow.WeChatAuth;
using Longbow.Web;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Claims;
@ -31,7 +21,6 @@ namespace Bootstrap.Admin.Controllers
/// Account controller.
/// </summary>
[AllowAnonymous]
[AutoValidateAntiforgeryToken]
public class AccountController : Controller
{
private const string MobileSchema = "Mobile";
@ -42,13 +31,12 @@ namespace Bootstrap.Admin.Controllers
[HttpGet]
public async Task<ActionResult> Lock()
{
if (!User.Identity!.IsAuthenticated) return Login();
if (!User.Identity.IsAuthenticated) return Login();
var authenticationType = User.Identity.AuthenticationType;
await HttpContext.SignOutAsync();
var urlReferrer = Request.Headers["Referer"].FirstOrDefault();
if (urlReferrer?.Contains("/Pages", StringComparison.OrdinalIgnoreCase) ?? false) urlReferrer = "/Pages";
return View(new LockModel(User.Identity.Name)
return View(new LockModel(this)
{
AuthenticationType = authenticationType,
ReturnUrl = WebUtility.UrlEncode(string.IsNullOrEmpty(urlReferrer) ? CookieAuthenticationDefaults.LoginPath.Value : urlReferrer)
@ -58,18 +46,18 @@ namespace Bootstrap.Admin.Controllers
/// <summary>
/// 系统锁屏界面
/// </summary>
/// <param name="provider"></param>
/// <param name="configuration"></param>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="authType"></param>
/// <returns></returns>
[HttpPost]
[IgnoreAntiforgeryToken]
public Task<IActionResult> Lock([FromServices] ISMSProvider provider, string userName, string password, string authType)
public Task<IActionResult> Lock([FromServices]IConfiguration configuration, string userName, string password, string authType)
{
// 根据不同的登陆方式
Task<IActionResult> ret;
if (authType == MobileSchema) ret = Mobile(provider, userName, password);
if (authType == MobileSchema) ret = Mobile(configuration, userName, password);
else ret = Login(userName, password, string.Empty);
return ret;
}
@ -77,44 +65,31 @@ namespace Bootstrap.Admin.Controllers
/// <summary>
/// 系统登录方法
/// </summary>
/// <param name="appId"></param>
/// <param name="view"></param>
/// <returns></returns>
[HttpGet]
public ActionResult Login([FromQuery] string? appId = null, [FromQuery] string view = "")
public ActionResult Login()
{
if (DictHelper.RetrieveSystemModel())
{
ViewBag.UserName = "Admin";
ViewBag.Password = "123789";
}
return User.Identity!.IsAuthenticated ? (ActionResult)Redirect("~/Home/Index") : LoginView(view, new LoginModel(appId));
}
private ViewResult LoginView(string view, LoginModel model)
{
if (string.IsNullOrEmpty(view))
{
// retrieve login view from db
view = DictHelper.RetrieveLoginView();
}
return View(view, model);
return User.Identity.IsAuthenticated ? (ActionResult)Redirect("~/Home/Index") : View("Login", new LoginModel());
}
/// <summary>
/// 短信验证登陆方法
/// </summary>
/// <param name="provider"></param>
/// <param name="configuration"></param>
/// <param name="phone"></param>
/// <param name="code"></param>
/// <returns></returns>
[HttpPost()]
public async Task<IActionResult> Mobile([FromServices] ISMSProvider provider, string phone, string code)
public async Task<IActionResult> Mobile([FromServices]IConfiguration configuration, [FromQuery]string phone, [FromQuery]string code)
{
if (string.IsNullOrEmpty(phone) || string.IsNullOrEmpty(code)) return RedirectLogin();
var auth = provider.Validate(phone, code);
await HttpContext.Log(phone, auth);
var option = configuration.GetSection(nameof(SMSOptions)).Get<SMSOptions>();
var auth = SMSHelper.Validate(phone, code, option.MD5Key);
HttpContext.Log(phone, auth);
if (auth)
{
var user = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == phone);
@ -129,27 +104,16 @@ namespace Bootstrap.Admin.Controllers
Password = code,
Icon = "default.jpg",
Description = "手机用户",
App = provider.Options.App
App = option.App
};
if (UserHelper.Save(user) && !string.IsNullOrEmpty(user.Id))
{
// 根据配置文件设置默认角色
var roles = RoleHelper.Retrieves().Where(r => provider.Options.Roles.Any(rl => rl.Equals(r.RoleName, StringComparison.OrdinalIgnoreCase))).Select(r => r.Id!);
RoleHelper.SaveByUserId(user.Id, roles);
}
UserHelper.Save(user);
// 根据配置文件设置默认角色
var roles = RoleHelper.Retrieves().Where(r => option.Roles.Any(rl => rl.Equals(r.RoleName, StringComparison.OrdinalIgnoreCase))).Select(r => r.Id);
RoleHelper.SaveByUserId(user.Id, roles);
}
}
return auth ? await SignInAsync(phone, true, MobileSchema) : RedirectLogin();
}
private IActionResult RedirectLogin()
{
var query = Request.Query.Aggregate(new Dictionary<string, string?>(), (d, v) =>
{
d.Add(v.Key, v.Value.ToString());
return d;
});
return Redirect(QueryHelpers.AddQueryString(Request.PathBase + CookieAuthenticationDefaults.LoginPath, query));
return auth ? await SignInAsync(phone, true, MobileSchema) : View("Login", new LoginModel() { AuthFailed = true });
}
/// <summary>
@ -160,13 +124,12 @@ namespace Bootstrap.Admin.Controllers
/// <param name="password">Password.</param>
/// <param name="remember">Remember.</param>
[HttpPost]
[IgnoreAntiforgeryToken]
public async Task<IActionResult> Login(string userName, string password, string remember)
{
if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password)) return RedirectLogin();
var auth = UserHelper.Authenticate(userName, password);
await HttpContext.Log(userName, auth);
return auth ? await SignInAsync(userName, remember == "true") : LoginView("", new LoginModel() { AuthFailed = true });
HttpContext.Log(userName, auth);
return auth ? await SignInAsync(userName, remember == "true") : View("Login", new LoginModel() { AuthFailed = true });
}
private async Task<IActionResult> SignInAsync(string userName, bool persistent, string authenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme)
@ -180,16 +143,31 @@ namespace Bootstrap.Admin.Controllers
return Redirect(originUrl);
}
/// <summary>
/// 创建登录用户信息
/// </summary>
/// <param name="ipLocator"></param>
/// <param name="context"></param>
/// <param name="loginUser"></param>
internal static void CreateLoginUser(IIPLocatorProvider ipLocator, HttpContext context, LoginUser loginUser)
{
loginUser.UserAgent = context.Request.Headers["User-Agent"];
var agent = new UserAgent(loginUser.UserAgent);
loginUser.Ip = context.Connection.RemoteIpAddress.ToIPv4String();
loginUser.City = ipLocator.Locate(loginUser.Ip);
loginUser.Browser = $"{agent.Browser?.Name} {agent.Browser?.Version}";
loginUser.OS = $"{agent.OS?.Name} {agent.OS?.Version}";
}
/// <summary>
/// Logout this instance.
/// </summary>
/// <param name="appId"></param>
/// <returns>The logout.</returns>
[HttpGet]
public async Task<IActionResult> Logout([FromQuery] string appId)
public async Task<IActionResult> Logout()
{
await HttpContext.SignOutAsync();
return Redirect(QueryHelpers.AddQueryString(Request.PathBase + CookieAuthenticationDefaults.LoginPath, "AppId", appId ?? BootstrapAppContext.AppId));
return Redirect(Request.PathBase + CookieAuthenticationDefaults.LoginPath);
}
/// <summary>
@ -205,7 +183,7 @@ namespace Bootstrap.Admin.Controllers
/// </summary>
/// <returns></returns>
[HttpGet]
public IActionResult Gitee([FromServices] IConfiguration config)
public IActionResult Gitee([FromServices]IConfiguration config)
{
var enabled = config.GetValue($"{nameof(GiteeOptions)}:Enabled", false);
return Challenge(enabled ? GiteeDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme);
@ -216,43 +194,10 @@ namespace Bootstrap.Admin.Controllers
/// </summary>
/// <returns></returns>
[HttpGet]
public IActionResult GitHub([FromServices] IConfiguration config)
public IActionResult GitHub([FromServices]IConfiguration config)
{
var enabled = config.GetValue($"{nameof(GitHubOptions)}:Enabled", false);
return Challenge(enabled ? GitHubDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme);
}
/// <summary>
/// Tencent 认证
/// </summary>
/// <returns></returns>
[HttpGet]
public IActionResult Tencent([FromServices] IConfiguration config)
{
var enabled = config.GetValue($"{nameof(TencentOptions)}:Enabled", false);
return Challenge(enabled ? TencentDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme);
}
/// <summary>
/// Alipay 认证
/// </summary>
/// <returns></returns>
[HttpGet]
public IActionResult Alipay([FromServices] IConfiguration config)
{
var enabled = config.GetValue($"{nameof(AlipayOptions)}:Enabled", false);
return Challenge(enabled ? AlipayDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme);
}
/// <summary>
/// WeChat 认证
/// </summary>
/// <returns></returns>
[HttpGet]
public IActionResult WeChat([FromServices] IConfiguration config)
{
var enabled = config.GetValue($"{nameof(WeChatOptions)}:Enabled", false);
return Challenge(enabled ? WeChatDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme);
}
}
}

View File

@ -1,8 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Models;
using Bootstrap.Admin.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
@ -11,85 +7,84 @@ using System;
namespace Bootstrap.Admin.Controllers
{
/// <summary>
/// 后台管理控制器
///
/// </summary>
[Authorize]
public class AdminController : Controller
{
/// <summary>
/// 后台管理首页
///
/// </summary>
/// <returns></returns>
public ActionResult Index() => View(new NavigatorBarModel(this));
/// <summary>
/// 用户维护
///
/// </summary>
/// <returns></returns>
public ActionResult Users() => View(new NavigatorBarModel(this));
/// <summary>
/// 部门维护
///
/// </summary>
/// <returns></returns>
public ActionResult Groups() => View(new NavigatorBarModel(this));
/// <summary>
/// 字典表维护
///
/// </summary>
/// <returns></returns>
public ActionResult Dicts() => View(new NavigatorBarModel(this));
/// <summary>
/// 角色维护
///
/// </summary>
/// <returns></returns>
public ActionResult Roles() => View(new NavigatorBarModel(this));
/// <summary>
/// 菜单维护
///
/// </summary>
/// <returns></returns>
public ActionResult Menus() => View(new NavigatorBarModel(this));
/// <summary>
/// 操作日志
///
/// </summary>
/// <returns></returns>
public ActionResult Logs() => View(new NavigatorBarModel(this));
/// <summary>
/// 脚本日志
///
/// </summary>
/// <returns></returns>
public ActionResult SQL() => View(new NavigatorBarModel(this));
/// <summary>
/// 访问日志
///
/// </summary>
/// <returns></returns>
public ActionResult Traces() => View(new NavigatorBarModel(this));
/// <summary>
/// 登录日志
///
/// </summary>
/// <returns></returns>
public ActionResult Logins() => View(new NavigatorBarModel(this));
/// <summary>
/// FA 图标页面
///
/// </summary>
/// <returns></returns>
public ActionResult FAIcon() => View(new NavigatorBarModel(this));
/// <summary>
/// 健康检查
///
/// </summary>
/// <returns></returns>
public ActionResult Healths() => View(new NavigatorBarModel(this));
/// <summary>
/// 图标视图
///
/// </summary>
/// <returns></returns>
[AllowAnonymous]
@ -97,51 +92,44 @@ namespace Bootstrap.Admin.Controllers
public PartialViewResult IconView() => PartialView("IconView");
/// <summary>
/// 侧边栏局部视图
/// </summary>
/// <returns></returns>
/// <remark>菜单维护页面增删菜单时局部刷新时调用</remark>
public PartialViewResult Sidebar() => PartialView("Sidebar", new NavigatorBarModel(this));
/// <summary>
/// 网站设置
///
/// </summary>
/// <returns></returns>
public ActionResult Settings() => View(new SettingsModel(this));
/// <summary>
/// 通知管理
///
/// </summary>
/// <returns></returns>
public ActionResult Notifications() => View(new NavigatorBarModel(this));
/// <summary>
/// 个人中心
///
/// </summary>
/// <param name="host"></param>
/// <returns></returns>
public ActionResult Profiles([FromServices]IWebHostEnvironment host) => View(new ProfilesModel(this, host));
public ActionResult Profiles([FromServices]IHostingEnvironment host) => View(new ProfilesModel(this, host));
/// <summary>
/// 程序异常
///
/// </summary>
/// <returns></returns>
public ActionResult Exceptions() => View(new NavigatorBarModel(this));
/// <summary>
/// 消息通知
///
/// </summary>
/// <returns></returns>
public ActionResult Messages() => View(new NavigatorBarModel(this));
/// <summary>
/// 任务管理
///
/// </summary>
/// <returns></returns>
public ActionResult Tasks() => View(new TaskModel(this));
/// <summary>
/// 客户端测试页面
///
/// </summary>
/// <returns></returns>
public ActionResult Mobile() => View(new NavigatorBarModel(this));

View File

@ -1,9 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authorization;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
@ -12,19 +7,18 @@ using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 网站分析控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class AnalyseController : ControllerBase
{
/// <summary>
/// 通过 logType 查询分析数据接口
///
/// </summary>
/// <returns></returns>
[HttpGet()]
public ActionResult<AnalyseData> Get([FromQuery]string logType)
public ActionResult<AnalyseData> Get([FromQuery]string logType = "")
{
var ret = new AnalyseData();
if (logType.Equals("LoginUsers", StringComparison.OrdinalIgnoreCase))
@ -64,19 +58,19 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 分析数据实体类
///
/// </summary>
public class AnalyseData
{
/// <summary>
/// 获得/设置 折线数据集合
///
/// </summary>
public IEnumerable<string> Polylines { get; set; } = new string[0];
public IEnumerable<string> Polylines { get; set; }
/// <summary>
/// 获得 数据集合
///
/// </summary>
public List<KeyValuePair<string, string>> Datas { get; } = new List<KeyValuePair<string, string>>();
public List<KeyValuePair<string, string>> Datas { get; set; } = new List<KeyValuePair<string, string>>();
}
}
}

View File

@ -0,0 +1,22 @@
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
///
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class AppsController : ControllerBase
{
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id}")]
public IEnumerable<App> Get(string id) => AppHelper.RetrievesByRoleId(id);
}
}

View File

@ -0,0 +1,47 @@
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 数据字典分类
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class CategoryController : ControllerBase
{
/// <summary>
/// 获取字典表中所有Category数据
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public IEnumerable<string> RetrieveDictCategorys()
{
return DictHelper.RetrieveCategories();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet]
public IEnumerable<string> RetrieveMenus()
{
return MenuHelper.RetrieveAllMenus(User.Identity.Name).OrderBy(m => m.Name).Select(m => m.Name);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet]
public IEnumerable<string> RetrieveParentMenus()
{
return MenuHelper.RetrieveMenus(User.Identity.Name).Where(m => m.Menus.Count() > 0).OrderBy(m => m.Name).Select(m => m.Name);
}
}
}

View File

@ -1,28 +1,22 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 字典表维护控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class DictsController : ControllerBase
{
/// <summary>
/// 获取所有字典表数据方法
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
@ -32,7 +26,7 @@ namespace Bootstrap.Admin.Controllers.Api
return value.RetrieveData();
}
/// <summary>
/// 保存字典方法
///
/// </summary>
/// <param name="value"></param>
[HttpPost]
@ -42,7 +36,7 @@ namespace Bootstrap.Admin.Controllers.Api
return DictHelper.Save(value);
}
/// <summary>
/// 删除字典项方法
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]
@ -53,4 +47,4 @@ namespace Bootstrap.Admin.Controllers.Api
return DictHelper.Delete(value);
}
}
}
}

View File

@ -0,0 +1,87 @@
using Bootstrap.Admin.Query;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
///
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class ExceptionsController : ControllerBase
{
/// <summary>
/// 显示所有异常
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<object> Get([FromQuery]QueryExceptionOption value)
{
return value.Retrieves();
}
/// <summary>
/// 异常程序页面点击服务器日志按钮获取所有物理日志文件列表方法
/// </summary>
/// <returns></returns>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Exceptions", Auth = "log")]
public IEnumerable<string> Post()
{
var filePath = Path.Combine(AppContext.BaseDirectory, "Error");
return Directory.Exists(filePath)
? Directory.GetFiles(filePath)
.Where(f => Path.GetExtension(f).Equals(".log", StringComparison.OrdinalIgnoreCase))
.Select(f => Path.GetFileNameWithoutExtension(f)).OrderByDescending(s => s)
: Enumerable.Empty<string>();
}
/// <summary>
/// 选中指定文件查看其内容方法
/// </summary>
/// <returns></returns>
[HttpPut]
[ButtonAuthorize(Url = "~/Admin/Exceptions", Auth = "log")]
public JsonResult Put([FromBody]ExceptionFileQuery exceptionFile)
{
var filePath = Path.Combine(AppContext.BaseDirectory, "Error");
var logName = $"{Path.Combine(filePath, exceptionFile.FileName)}.log";
if (!System.IO.File.Exists(logName)) return new JsonResult("无此日志文件");
StringBuilder sb = new StringBuilder();
using (StreamReader reader = new StreamReader(logName))
{
while (!reader.EndOfStream)
{
var line = reader.ReadLine().Replace("<", "&lt;").Replace(">", "&gt;");
if (line == "General Information ") sb.AppendFormat("<h4><b>{0}</b></h4>", line);
else if (line.StartsWith("TimeStamp:")) sb.AppendFormat("<div class='logTs'>{0}</div>", line);
else if (line.EndsWith("Exception Information")) sb.AppendFormat("<div class='logExcep'>{0}</div>", line);
else if (line.StartsWith("Message:")) sb.AppendFormat("<div class='logMsg'>{0}</div>", line);
else if (line.StartsWith("ErrorSql:")) sb.AppendFormat("<div class='logSql'>{0}</div>", line);
else if (line.StartsWith("Exception Type: Longbow.Data.DBAccessException")) sb.AppendFormat("<div class='logDbExcep'>{0}</div>", line);
else if (line.StartsWith("StackTrace Information")) sb.AppendFormat("<b>{0}</b><br>", line);
else sb.AppendFormat("{0}<br>", line);
}
}
return new JsonResult(sb.ToString());
}
/// <summary>
///
/// </summary>
public class ExceptionFileQuery
{
/// <summary>
///
/// </summary>
public string FileName { get; set; }
}
}
}

View File

@ -0,0 +1,140 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// Gitee 网站信息接口类
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
[AllowAnonymous]
public class GiteeController : ControllerBase
{
/// <summary>
/// 获取 Gitee 网站 Issues 信息
/// </summary>
/// <param name="client"></param>
/// <param name="userName"></param>
/// <param name="repoName"></param>
/// <param name="label"></param>
/// <param name="color"></param>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult> Issues([FromServices]GiteeHttpClient client, [FromQuery]string userName = "LongbowEnterprise", [FromQuery]string repoName = "BootstrapAdmin", [FromQuery]string label = "custom badge", [FromQuery]string color = "orange")
{
var ret = await GetJsonAsync(() => client.HttpClient.GetStringAsync($"https://gitee.com/{userName}/{repoName}/issues"), content =>
{
var regex = Regex.Matches(content, "<div class='ui mini circular label'>([\\d]+)</div>", RegexOptions.IgnoreCase);
var labels = new string[] { "open", "progressing", "closed", "rejected" };
var result = string.IsNullOrEmpty(content) ? new string[] { "unknown" } : regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}");
return string.Join(" ", result);
});
color = ret.StartsWith("open 0 progressing 0") ? "success" : color;
return new JsonResult(new { schemaVersion = 1, label, message = ret, color });
}
/// <summary>
/// 获取 Gitee 网站 Pulls 信息
/// </summary>
/// <param name="client"></param>
/// <param name="userName"></param>
/// <param name="repoName"></param>
/// <param name="label"></param>
/// <param name="color"></param>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult> Pulls([FromServices]GiteeHttpClient client, [FromQuery]string userName = "LongbowEnterprise", [FromQuery]string repoName = "BootstrapAdmin", [FromQuery]string label = "custom badge", [FromQuery]string color = "orange")
{
var ret = await GetJsonAsync(() => client.HttpClient.GetStringAsync($"https://gitee.com/{userName}/{repoName}/pulls"), content =>
{
var regex = Regex.Matches(content, "<div class='ui mini circular label'>([\\d]+)</div>", RegexOptions.IgnoreCase);
var labels = new string[] { "open", "merged", "closed" };
var result = string.IsNullOrEmpty(content) ? new string[] { "unknown" } : regex.Select((m, i) => $"{labels[i]} {m.Groups[1].Value}");
return string.Join(" ", result);
});
return new JsonResult(new { schemaVersion = 1, label, message = ret, color });
}
/// <summary>
/// 获取 Gitee 网站 Releases 信息
/// </summary>
/// <param name="client"></param>
/// <param name="userName"></param>
/// <param name="repoName"></param>
/// <param name="label"></param>
/// <param name="color"></param>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult> Releases([FromServices]GiteeHttpClient client, [FromQuery]string userName = "LongbowEnterprise", [FromQuery]string repoName = "BootstrapAdmin", [FromQuery]string label = "custom badge", [FromQuery]string color = "orange")
{
var ret = await GetJsonAsync(() => client.HttpClient.GetStringAsync($"https://gitee.com/{userName}/{repoName}/releases"), content =>
{
var regex = Regex.Match(content, $"<a href=\"/{userName}/{repoName}/releases/([^\\s]+)\" target=\"_blank\">", RegexOptions.IgnoreCase);
return string.IsNullOrEmpty(content) ? "unknown" : regex.Groups[1].Value;
});
return new JsonResult(new { schemaVersion = 1, label, message = ret, color });
}
/// <summary>
/// 获取 Gitee 网站 Builds 信息
/// </summary>
/// <param name="client"></param>
/// <param name="userName"></param>
/// <param name="projName"></param>
/// <param name="branchName"></param>
/// <param name="label"></param>
/// <param name="color"></param>
/// <returns></returns>
[HttpGet]
public async Task<ActionResult> Builds([FromServices]GiteeHttpClient client, [FromQuery]string userName = "ArgoZhang", [FromQuery]string projName = "bootstrapadmin", [FromQuery]string branchName = "master", [FromQuery]string label = "custom badge", [FromQuery]string color = "orange")
{
var ret = await GetJsonAsync(() => client.HttpClient.GetAsJsonAsync<AppveyorBuildResult>($"https://ci.appveyor.com/api/projects/{userName}/{projName}/branch/{branchName}", null, new CancellationTokenSource(10000).Token), content =>
{
return content == null ? "unknown" : content.Build.Version;
});
return new JsonResult(new { schemaVersion = 1, label, message = ret, color });
}
private async static Task<string> GetJsonAsync<T>(Func<Task<T>> requestUrl, Func<T, string> callback)
{
var ret = "unresponsive";
try
{
var resq = await requestUrl();
ret = callback(resq);
}
catch (OperationCanceledException)
{
}
catch (Exception ex)
{
ex.Log();
}
return ret;
}
private class AppveyorBuildResult
{
/// <summary>
/// Appveyor 编译版本实例
/// </summary>
public Build Build { get; set; }
}
private class Build
{
/// <summary>
/// Build 版本信息
/// </summary>
public string Version { get; set; }
}
}
}

View File

@ -1,27 +1,21 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 部门维护控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class GroupsController : ControllerBase
{
/// <summary>
/// 部门数据查询方法
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
@ -32,7 +26,18 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 保存部门方法
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id}")]
public Group Get(string id)
{
return GroupHelper.Retrieves().FirstOrDefault(t => t.Id == id);
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
[HttpPost]
@ -43,7 +48,7 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 删除部门方法
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]
@ -56,7 +61,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <summary>
/// 获取部门授权
/// </summary>
/// <param name="id">用户ID或者角色ID</param>
/// <param name="id"></param>
/// <param name="type"></param>
/// <returns></returns>
[HttpPost("{id}")]

View File

@ -1,18 +1,14 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Bootstrap.Security.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Security.Principal;
namespace Bootstrap.Admin.Controllers
{
/// <summary>
/// 接口控制器
///
/// </summary>
[Route("api/[controller]/[action]")]
[AllowAnonymous]
@ -20,7 +16,7 @@ namespace Bootstrap.Admin.Controllers
public class InterfaceController : ControllerBase
{
/// <summary>
/// 获取所有字典表数据
///
/// </summary>
/// <returns></returns>
[HttpPost]
@ -28,19 +24,17 @@ namespace Bootstrap.Admin.Controllers
{
return DictHelper.RetrieveDicts();
}
/// <summary>
/// 通过请求地址获取相对应角色集合
///
/// </summary>
/// <returns></returns>
[HttpPost]
public IEnumerable<string> RetrieveRolesByUrl([FromBody]string url)
{
return RoleHelper.RetrievesByUrl(url, BootstrapAppContext.AppId);
return RoleHelper.RetrievesByUrl(url);
}
/// <summary>
/// 通过用户名获得分配所有角色
///
/// </summary>
/// <returns></returns>
[HttpPost]
@ -48,23 +42,23 @@ namespace Bootstrap.Admin.Controllers
{
return RoleHelper.RetrievesByUserName(userName);
}
/// <summary>
/// 通过用户名获得 User 实例
///
/// </summary>
/// <returns></returns>
[HttpPost]
public BootstrapUser? RetrieveUserByUserName([FromBody]string userName)
public BootstrapUser RetrieveUserByUserName([FromBody]string userName)
{
return UserHelper.RetrieveUserByUserName(userName);
return UserHelper.RetrieveUserByUserName(new GenericIdentity(userName));
}
/// <summary>
/// 通过指定条件获得应用程序菜单
///
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
[HttpPost]
public IEnumerable<BootstrapMenu> RetrieveAppMenus([FromBody]AppMenuOption args) => MenuHelper.RetrieveAppMenus(args.AppId, args.UserName, args.Url);
public IEnumerable<BootstrapMenu> RetrieveAppMenus([FromBody]AppMenuOption args)
{
return MenuHelper.RetrieveAppMenus(args.AppId, args.UserName, args.Url);
}
}
}

View File

@ -0,0 +1,79 @@
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security.Authentication;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 登陆接口
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class LoginController : ControllerBase
{
/// <summary>
/// 获得登录历史记录
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<LoginUser> Get([FromQuery]QueryLoginOption value) => value.RetrieveData();
/// <summary>
/// JWT 登陆认证接口
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[AllowAnonymous]
[HttpPost]
public string Post([FromBody]JObject value)
{
string token = null;
dynamic user = value;
string userName = user.userName;
string password = user.password;
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password) && UserHelper.Authenticate(userName, password))
{
token = BootstrapAdminJwtTokenHandler.CreateToken(userName);
}
HttpContext.Log(userName, token != null);
return token;
}
/// <summary>
/// 下发手机短信方法
/// </summary>
/// <param name="configuration"></param>
/// <param name="factory"></param>
/// <param name="phone"></param>
/// <returns></returns>
[AllowAnonymous]
[HttpPut]
public async Task<bool> Put([FromServices]IConfiguration configuration, [FromServices]IHttpClientFactory factory, [FromQuery]string phone)
{
if (string.IsNullOrEmpty(phone)) return false;
var option = configuration.GetSection(nameof(SMSOptions)).Get<SMSOptions>();
option.Phone = phone;
return await factory.CreateClient().SendCode(option);
}
/// <summary>
/// 跨域握手协议
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpOptions]
public string Options()
{
return null;
}
}
}

View File

@ -1,53 +1,47 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 操作日志控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class LogsController : ControllerBase
{
/// <summary>
/// 前台获取操作日志数据调用
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<Log> Get([FromQuery] QueryLogOption value)
public QueryData<Log> Get([FromQuery]QueryLogOption value)
{
return value.RetrieveData();
}
/// <summary>
/// 操作日志记录方法
///
/// </summary>
/// <param name="onlineUserSvr"></param>
/// <param name="ipLocator"></param>
/// <param name="value"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Post([FromServices] IIPLocatorProvider ipLocator, [FromBody] Log value)
public bool Post([FromServices]IOnlineUsers onlineUserSvr, [FromServices]IIPLocatorProvider ipLocator, [FromBody]Log value)
{
value.UserAgent = Request.Headers["User-Agent"];
var agent = new UserAgent(value.UserAgent);
value.Ip = HttpContext.Connection.RemoteIpAddress?.ToIPv4String() ?? "";
value.Ip = HttpContext.Connection.RemoteIpAddress.ToIPv4String();
value.Browser = $"{agent.Browser?.Name} {agent.Browser?.Version}";
value.OS = $"{agent.OS?.Name} {agent.OS?.Version}";
value.City = await ipLocator.Locate(value.Ip);
value.UserName = User.Identity?.Name ?? string.Empty;
value.City = ipLocator.Locate(value.Ip);
value.UserName = User.Identity.Name;
return LogHelper.Save(value);
}
}

View File

@ -1,14 +1,8 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
@ -17,7 +11,6 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class MenusController : ControllerBase
{
@ -29,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api
[HttpGet]
public QueryData<object> Get([FromQuery]QueryMenuOption value)
{
return value.RetrieveData(User.Identity!.Name);
return value.RetrieveData(User.Identity.Name);
}
/// <summary>
@ -70,7 +63,7 @@ namespace Bootstrap.Admin.Controllers.Api
ret = MenuHelper.RetrieveMenusByRoleId(id);
break;
case "user":
ret = MenuHelper.RetrieveMenus(User.Identity!.Name);
ret = MenuHelper.RetrieveMenus(User.Identity.Name);
break;
}
return ret;
@ -89,4 +82,4 @@ namespace Bootstrap.Admin.Controllers.Api
return RoleHelper.SavaByMenuId(id, roleIds);
}
}
}
}

View File

@ -1,10 +1,5 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Models;
using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
@ -16,7 +11,6 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class MessagesController : ControllerBase
{
@ -32,16 +26,16 @@ namespace Bootstrap.Admin.Controllers.Api
switch (id)
{
case "inbox":
ret = MessageHelper.Inbox(User.Identity!.Name).ToList();
ret = MessageHelper.Inbox(User.Identity.Name).ToList();
break;
case "sendmail":
ret = MessageHelper.SendMail(User.Identity!.Name).ToList();
ret = MessageHelper.SendMail(User.Identity.Name).ToList();
break;
case "mark":
ret = MessageHelper.Mark(User.Identity!.Name).ToList();
ret = MessageHelper.Mark(User.Identity.Name).ToList();
break;
case "trash":
ret = MessageHelper.Trash(User.Identity!.Name).ToList();
ret = MessageHelper.Trash(User.Identity.Name).ToList();
break;
}
return ret;
@ -56,12 +50,12 @@ namespace Bootstrap.Admin.Controllers.Api
{
var mcm = new MessageCountModel
{
InboxCount = MessageHelper.Inbox(User.Identity!.Name).Count(),
SendmailCount = MessageHelper.SendMail(User.Identity!.Name).Count(),
MarkCount = MessageHelper.Mark(User.Identity!.Name).Count(),
TrashCount = MessageHelper.Trash(User.Identity!.Name).Count()
InboxCount = MessageHelper.Inbox(User.Identity.Name).Count(),
SendmailCount = MessageHelper.SendMail(User.Identity.Name).Count(),
MarkCount = MessageHelper.Mark(User.Identity.Name).Count(),
TrashCount = MessageHelper.Trash(User.Identity.Name).Count()
};
return mcm;
}
}
}
}

View File

@ -1,9 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authorization;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
@ -11,10 +6,9 @@ using System.Linq;
namespace Bootstrap.Admin.Controllers
{
/// <summary>
/// 新用户注册控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class NewController : ControllerBase
{
@ -42,19 +36,15 @@ namespace Bootstrap.Admin.Controllers
public bool Put([FromBody]User value)
{
var ret = false;
var userName = User.Identity!.Name;
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(value.Id))
if (value.UserStatus == UserStates.ApproveUser)
{
if (value.UserStatus == UserStates.ApproveUser)
{
ret = UserHelper.Approve(value.Id, userName);
}
else if (value.UserStatus == UserStates.RejectUser)
{
ret = UserHelper.Reject(value.Id, userName);
}
ret = UserHelper.Approve(value.Id, User.Identity.Name);
}
else if (value.UserStatus == UserStates.RejectUser)
{
ret = UserHelper.Reject(value.Id, User.Identity.Name);
}
return ret;
}
}
}
}

View File

@ -1,26 +1,19 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using Longbow.Tasks;
using Microsoft.AspNetCore.Authorization;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 系统通知控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class NotificationsController : ControllerBase
{
/// <summary>
/// 后台 Header 状态条调用
///
/// </summary>
/// <returns></returns>
[HttpGet]
@ -43,15 +36,15 @@ namespace Bootstrap.Admin.Controllers.Api
});
// Tasks
var task = TaskServicesManager.ToList().Where(s => s.NextRuntime != null).Select(s => new { s.Name, s.LastRuntime, s.LastRunResult });
var task = TaskHelper.Retrieves();
var tasksCount = task.Count();
//Message
var message = MessageHelper.Retrieves(User.Identity!.Name);
var message = MessageHelper.Retrieves(User.Identity.Name);
var messagesCount = message.Count();
message = message.Take(6);
message.AsParallel().ForAll(m => m.FromIcon = Url.Content(m.FromIcon) ?? string.Empty);
message.AsParallel().ForAll(m => m.FromIcon = Url.Content(m.FromIcon));
//Apps
var apps = ExceptionsHelper.Retrieves().Where(n => n.Category != "DB");
@ -60,7 +53,7 @@ namespace Bootstrap.Admin.Controllers.Api
apps = apps.Take(6);
apps.AsParallel().ForAll(n =>
{
n.ExceptionType = n.ExceptionType?.Split('.').Last();
n.ExceptionType = n.ExceptionType.Split('.').Last();
var ts = DateTime.Now - n.LogTime;
if (ts.TotalMinutes < 5) n.Period = "刚刚";
else if (ts.Days > 0) n.Period = string.Format("{0}天", ts.Days);
@ -97,4 +90,4 @@ namespace Bootstrap.Admin.Controllers.Api
};
}
}
}
}

View File

@ -1,8 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Longbow.Web;
using Longbow.Web;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
@ -18,7 +14,6 @@ namespace Bootstrap.Admin.Controllers.Api
/// 在线用户接口
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class OnlineUsersController : ControllerBase
{
@ -27,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <returns></returns>
[HttpGet()]
public IEnumerable<OnlineUser> Get([FromServices] IOnlineUsers onlineUSers)
public IEnumerable<OnlineUser> Get([FromServices]IOnlineUsers onlineUSers)
{
return onlineUSers.OnlineUsers.OrderByDescending(u => u.LastAccessTime);
}
@ -39,7 +34,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="onlineUSers"></param>
/// <returns></returns>
[HttpGet("{id}")]
public IEnumerable<KeyValuePair<DateTime, string>> Get(string id, [FromServices] IOnlineUsers onlineUSers)
public IEnumerable<KeyValuePair<DateTime, string>> Get(string id, [FromServices]IOnlineUsers onlineUSers)
{
var user = onlineUSers.OnlineUsers.FirstOrDefault(u => u.ConnectionId == id);
return user?.RequestUrls ?? new KeyValuePair<DateTime, string>[0];
@ -53,7 +48,7 @@ namespace Bootstrap.Admin.Controllers.Api
[AllowAnonymous]
public bool Put()
{
var ip = Request.HttpContext.Connection.RemoteIpAddress?.ToIPv4String() ?? "";
var ip = Request.HttpContext.Connection.RemoteIpAddress.ToIPv4String();
if (_loginUsers.TryGetValue(ip, out var user))
{
user.Reset();
@ -76,7 +71,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <summary>
///
/// </summary>
public string? Ip { get; set; }
public string Ip { get; set; }
/// <summary>
///
@ -112,7 +107,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
public void Reset()
{
dispatcher.Change(TimeSpan.FromSeconds(30), Timeout.InfiniteTimeSpan);
if (dispatcher != null) dispatcher.Change(TimeSpan.FromSeconds(30), Timeout.InfiniteTimeSpan);
}
#region Impletement IDispose
@ -127,6 +122,7 @@ namespace Bootstrap.Admin.Controllers.Api
if (dispatcher != null)
{
dispatcher.Dispose();
dispatcher = null;
}
}
}

View File

@ -1,13 +1,7 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.IO;
using System.Threading.Tasks;
@ -15,10 +9,9 @@ using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 个人中心控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class ProfilesController : ControllerBase
{
@ -31,10 +24,13 @@ namespace Bootstrap.Admin.Controllers.Api
/// <returns></returns>
[HttpPost("{id}")]
[ButtonAuthorize(Url = "~/Admin/Profiles", Auth = "saveIcon")]
public JsonResult Post(string id, [FromServices] IWebHostEnvironment env, [FromForm] DeleteFileCollection files)
public JsonResult Post(string id, [FromServices]IHostingEnvironment env, [FromForm]DeleteFileCollection files)
{
if (!id.Equals("Delete", StringComparison.OrdinalIgnoreCase)) return new JsonResult(new object());
var userName = User.Identity!.Name;
var previewUrl = string.Empty;
long fileSize = 0;
var userName = User.Identity.Name;
var fileName = files.Key;
fileName = Path.Combine(env.WebRootPath, $"images{Path.DirectorySeparatorChar}uploader{Path.DirectorySeparatorChar}{fileName}");
@ -42,10 +38,10 @@ namespace Bootstrap.Admin.Controllers.Api
fileName = "default.jpg";
var webSiteUrl = DictHelper.RetrieveIconFolderPath();
var filePath = Path.Combine(env.WebRootPath, webSiteUrl.Replace("~", string.Empty).Replace('/', Path.DirectorySeparatorChar).TrimStart(Path.DirectorySeparatorChar) + fileName);
var fileSize = new FileInfo(filePath).Length;
fileSize = new FileInfo(filePath).Length;
var iconName = $"{fileName}?v={DateTime.Now.Ticks}";
var previewUrl = Url.Content($"{webSiteUrl}{iconName}") ?? string.Empty;
if (!string.IsNullOrEmpty(userName)) UserHelper.SaveUserIconByName(userName, iconName);
previewUrl = Url.Content($"{webSiteUrl}{iconName}");
UserHelper.SaveUserIconByName(userName, iconName);
return new JsonResult(new
{
@ -58,14 +54,14 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 待删除文件集合类
///
/// </summary>
public class DeleteFileCollection
{
/// <summary>
/// 获得/设置 文件名称
///
/// </summary>
public string Key { get; set; } = "";
public string Key { get; set; }
}
/// <summary>
@ -76,11 +72,11 @@ namespace Bootstrap.Admin.Controllers.Api
/// <returns></returns>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Profiles", Auth = "saveIcon")]
public async Task<JsonResult> Post([FromServices] IWebHostEnvironment env, IFormCollection files)
public async Task<JsonResult> Post([FromServices]IHostingEnvironment env, IFormCollection files)
{
string? previewUrl = null;
var previewUrl = string.Empty;
long fileSize = 0;
var userName = User.Identity!.Name;
var userName = User.Identity.Name;
var fileName = string.Empty;
if (files.Files.Count > 0)
{
@ -88,18 +84,20 @@ namespace Bootstrap.Admin.Controllers.Api
var webSiteUrl = DictHelper.RetrieveIconFolderPath();
fileName = $"{userName}{Path.GetExtension(uploadFile.FileName)}";
var filePath = Path.Combine(env.WebRootPath, webSiteUrl.Replace("~", string.Empty).Replace('/', Path.DirectorySeparatorChar).TrimStart(Path.DirectorySeparatorChar) + fileName);
var fileFolder = Path.GetDirectoryName(filePath);
fileSize = uploadFile.Length;
if (!Directory.Exists(fileFolder)) Directory.CreateDirectory(fileFolder);
using (var fs = new FileStream(filePath, FileMode.Create))
{
await uploadFile.CopyToAsync(fs);
}
var iconName = $"{fileName}?v={DateTime.Now.Ticks}";
previewUrl = Url.Content($"{webSiteUrl}{iconName}");
if (!string.IsNullOrEmpty(userName)) UserHelper.SaveUserIconByName(userName, iconName);
UserHelper.SaveUserIconByName(userName, iconName);
}
return new JsonResult(new
{
initialPreview = new string[] { previewUrl ?? string.Empty },
initialPreview = new string[] { previewUrl },
initialPreviewConfig = new object[] {
new { caption = "新头像", size = fileSize, showZoom = true, key = fileName }
},
@ -108,26 +106,26 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 个人中心操作方法 更改样式 更改显示名称 更改默认应用
///
/// </summary>
/// <returns></returns>
[HttpPut]
[ButtonAuthorize(Url = "~/Admin/Profiles", Auth = "saveDisplayName,savePassword,saveApp,saveTheme")]
public bool Put([FromBody] User value)
public bool Put([FromBody]User value)
{
var ret = false;
if (value.UserName.Equals(User.Identity!.Name, StringComparison.OrdinalIgnoreCase))
if (value.UserName.Equals(User.Identity.Name, StringComparison.OrdinalIgnoreCase))
{
ret = value.UserStatus switch
{
UserStates.ChangeTheme => UserHelper.SaveUserCssByName(value.UserName, value.Css),
UserStates.ChangeDisplayName => UserHelper.SaveDisplayName(value.UserName, value.DisplayName),
UserStates.ChangePassword => UserHelper.ChangePassword(value.UserName, value.Password, value.NewPassword),
UserStates.SaveApp => UserHelper.SaveApp(value.UserName, value.App),
_ => false
};
if (value.UserStatus == UserStates.ChangeTheme)
ret = UserHelper.SaveUserCssByName(value.UserName, value.Css);
else if (value.UserStatus == UserStates.ChangeDisplayName)
ret = UserHelper.SaveDisplayName(value.UserName, value.DisplayName);
else if (value.UserStatus == UserStates.ChangePassword)
ret = UserHelper.ChangePassword(value.UserName, value.Password, value.NewPassword);
else if (value.UserStatus == UserStates.SaveApp)
ret = UserHelper.SaveApp(value.UserName, value.App);
}
return ret;
}
}
}
}

View File

@ -1,13 +1,10 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Longbow.Web.SignalR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using System.Linq;
using System.Security.Principal;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
@ -15,8 +12,8 @@ namespace Bootstrap.Admin.Controllers.Api
/// <summary>
/// 注册用户操作类
/// </summary>
[Route("api/[controller]")]
[AllowAnonymous]
[Route("api/[controller]")]
[ApiController]
public class RegisterController : ControllerBase
{
@ -28,7 +25,7 @@ namespace Bootstrap.Admin.Controllers.Api
[HttpGet]
public bool Get(string userName)
{
return UserHelper.RetrieveUserByUserName(userName) == null && !UserHelper.RetrieveNewUsers().Any(u => u.UserName == userName);
return UserHelper.RetrieveUserByUserName(new GenericIdentity(userName)) == null && !UserHelper.RetrieveNewUsers().Any(u => u.UserName == userName);
}
/// <summary>
@ -61,7 +58,7 @@ namespace Bootstrap.Admin.Controllers.Api
[HttpPut]
public bool Put([FromBody]ResetUser user)
{
if (UserHelper.RetrieveUserByUserName(user.UserName) == null) return true;
if (UserHelper.RetrieveUserByUserName(new GenericIdentity(user.UserName)) == null) return true;
return UserHelper.ForgotPassword(user);
}
}

View File

@ -1,13 +1,7 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Collections.Generic;
using System.Linq;
@ -15,15 +9,14 @@ using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 角色维护控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class RolesController : ControllerBase
{
/// <summary>
/// 获取所有角色数据
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
@ -41,17 +34,23 @@ namespace Bootstrap.Admin.Controllers.Api
[HttpPost("{id}")]
public IEnumerable<object> Post(string id, [FromQuery]string type)
{
var ret = type switch
IEnumerable<Role> ret = new List<Role>();
switch (type)
{
"user" => RoleHelper.RetrievesByUserId(id),
"group" => RoleHelper.RetrievesByGroupId(id),
"menu" => RoleHelper.RetrievesByMenuId(id),
_ => new Role[0]
};
case "user":
ret = RoleHelper.RetrievesByUserId(id);
break;
case "group":
ret = RoleHelper.RetrievesByGroupId(id);
break;
case "menu":
ret = RoleHelper.RetrievesByMenuId(id);
break;
}
return ret.Select(m => new { m.Id, m.Checked, m.RoleName, m.Description });
}
/// <summary>
/// 保存角色授权方法
/// 保存角色
/// </summary>
/// <param name="id">角色ID</param>
/// <param name="values">选中的ID集合</param>
@ -59,16 +58,28 @@ namespace Bootstrap.Admin.Controllers.Api
/// <returns></returns>
[HttpPut("{id}")]
[ButtonAuthorize(Url = "~/Admin/Roles", Auth = "assignUser,assignGroup,assignMenu,assignApp")]
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type) => type switch
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type)
{
"user" => UserHelper.SaveByRoleId(id, values),
"group" => GroupHelper.SaveByRoleId(id, values),
"menu" => MenuHelper.SaveMenusByRoleId(id, values),
"app" => AppHelper.SaveByRoleId(id, values),
_ => false
};
var ret = false;
switch (type)
{
case "user":
ret = UserHelper.SaveByRoleId(id, values);
break;
case "group":
ret = GroupHelper.SaveByRoleId(id, values);
break;
case "menu":
ret = MenuHelper.SaveMenusByRoleId(id, values);
break;
case "app":
ret = AppHelper.SaveByRoleId(id, values);
break;
}
return ret;
}
/// <summary>
/// 保存角色方法
///
/// </summary>
/// <param name="value"></param>
[HttpPost]
@ -78,7 +89,7 @@ namespace Bootstrap.Admin.Controllers.Api
return RoleHelper.Save(value);
}
/// <summary>
/// 删除角色方法
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]

View File

@ -1,11 +1,6 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bootstrap.Admin.Controllers.Api
@ -14,7 +9,6 @@ namespace Bootstrap.Admin.Controllers.Api
/// SQL 语句执行日志 webapi
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class SQLController : ControllerBase
{

View File

@ -0,0 +1,31 @@
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Cache;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
///
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class SettingsController : ControllerBase
{
/// <summary>
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Settings", Auth = "saveTitle,saveFooter,saveTheme,saveUISettings")]
public bool Post([FromBody]BootstrapDict value) => DictHelper.SaveSettings(value);
/// <summary>
///
/// </summary>
[HttpGet]
public IEnumerable<ICacheCorsItem> Get() => CacheManager.CorsSites;
}
}

View File

@ -0,0 +1,25 @@
using Longbow.Tasks;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
///
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class TasksController : ControllerBase
{
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet]
public IEnumerable<object> Get()
{
return TaskServicesManager.ToList().Select(s => new { s.Name, Status = s.Status.ToString(), s.LastRuntime, s.CreatedTime, s.NextRuntime, LastRunResult = s.Triggers.First().LastResult.ToString(), TriggerExpression = s.Triggers.FirstOrDefault().ToString() }).OrderBy(s => s.Name);
}
}
}

View File

@ -1,9 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Longbow.Tasks;
using Microsoft.AspNetCore.Authorization;
using Longbow.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using System.Linq;
@ -12,10 +7,9 @@ using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 任务日志控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class TasksLogController : ControllerBase
{
@ -29,14 +23,9 @@ namespace Bootstrap.Admin.Controllers.Api
public ActionResult Get([FromQuery]string name, [FromServices]IHubContext<TaskLogHub> hub)
{
var sche = TaskServicesManager.Get(name);
var ret = false;
if (sche != null)
{
sche.Triggers.First().PulseCallback = t => SendTaskLog(sche, name, hub);
SendTaskLog(sche, name, hub);
ret = true;
}
return Ok(ret);
sche.Triggers.First().PulseCallback = t => SendTaskLog(sche, name, hub);
SendTaskLog(sche, name, hub);
return Ok(true);
}
private Task SendTaskLog(IScheduler sche, string name, IHubContext<TaskLogHub> hub)

View File

@ -1,26 +1,20 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 在线用户跟踪控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class TracesController : ControllerBase
{
/// <summary>
/// 客户端脚本获取在线用户数据
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>

View File

@ -1,13 +1,8 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
@ -15,15 +10,14 @@ using System.Linq;
namespace Bootstrap.Admin.Controllers.Api
{
/// <summary>
/// 用户控制器
///
/// </summary>
[Route("api/[controller]")]
[Authorize]
[ApiController]
public class UsersController : ControllerBase
{
/// <summary>
/// 调用获取所有用户信息 用户管理查询按钮
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
@ -34,25 +28,35 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 用户相关授权操作
///
/// </summary>
/// <param name="id">主键</param>
/// <param name="type">类型 如角色、部门</param>
/// <param name="id"></param>
/// <param name="type"></param>
/// <returns></returns>
[HttpPost("{id}")]
public IEnumerable<object> Post(string id, [FromQuery]string type) => type switch
public IEnumerable<object> Post(string id, [FromQuery]string type)
{
"role" => UserHelper.RetrievesByRoleId(id).Select(p => new
IEnumerable<object> ret = null;
switch (type)
{
p.Id,
p.DisplayName,
p.UserName,
p.Checked
}).OrderBy(u => u.DisplayName),
"group" => UserHelper.RetrievesByGroupId(id),
"reset" => UserHelper.RetrieveResetReasonsByUserName(id).Select(u => new { u.Key, u.Value }),
_ => new string[0]
};
case "role":
ret = UserHelper.RetrievesByRoleId(id).Select(p => new
{
p.Id,
p.DisplayName,
p.UserName,
p.Checked
});
break;
case "group":
ret = UserHelper.RetrievesByGroupId(id);
break;
case "reset":
ret = UserHelper.RetrieveResetReasonsByUserName(id).Select(u => new { u.Key, u.Value });
break;
}
return ret;
}
/// <summary>
/// 前台User View调用新建/更新用户
@ -62,10 +66,10 @@ namespace Bootstrap.Admin.Controllers.Api
[ButtonAuthorize(Url = "~/Admin/Users", Auth = "add,edit")]
public bool Post([FromBody]User value)
{
bool ret;
var ret = false;
if (string.IsNullOrEmpty(value.Id))
{
value.Description = string.Format("管理员{0}创建用户", User.Identity!.Name);
value.Description = string.Format("管理员{0}创建用户", User.Identity.Name);
value.ApprovedBy = User.Identity.Name;
value.ApprovedTime = DateTime.Now;
ret = UserHelper.Save(value);
@ -78,7 +82,7 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// 保存授权操作
///
/// </summary>
/// <param name="id"></param>
/// <param name="values"></param>
@ -86,15 +90,23 @@ namespace Bootstrap.Admin.Controllers.Api
/// <returns></returns>
[HttpPut("{id}")]
[ButtonAuthorize(Url = "~/Admin/Users", Auth = "assignRole,assignGroup")]
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type) => type switch
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type)
{
"role" => RoleHelper.SaveByUserId(id, values),
"group" => GroupHelper.SaveByUserId(id, values),
_ => false
};
var ret = false;
switch (type)
{
case "role":
ret = RoleHelper.SaveByUserId(id, values);
break;
case "group":
ret = GroupHelper.SaveByUserId(id, values);
break;
}
return ret;
}
/// <summary>
/// 删除用户操作
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]
@ -105,14 +117,14 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
/// api 握手协议
///
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpOptions]
public string? Options()
public string Options()
{
return null;
}
}
}
}

View File

@ -1,8 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.Models;
using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
@ -11,32 +7,31 @@ using Microsoft.AspNetCore.Mvc;
namespace Bootstrap.Admin.Controllers
{
/// <summary>
/// Home Controller
///
/// </summary>
[Authorize]
public class HomeController : Controller
{
/// <summary>
/// Index View
///
/// </summary>
/// <returns></returns>
public IActionResult Index()
{
var model = new HeaderBarModel(User.Identity!.Name);
var homeUrl = DictHelper.RetrieveHomeUrl(User.Identity.Name, model.AppId);
var useBlazor = DictHelper.RetrieveEnableBlazor();
return homeUrl.Equals("~/Home/Index", System.StringComparison.OrdinalIgnoreCase) ? (useBlazor ? Redirect("~/Pages") : (IActionResult)View(model)) : Redirect(homeUrl);
var model = new HeaderBarModel(User.Identity);
if (string.IsNullOrEmpty(model.UserName)) return Redirect(Request.PathBase + CookieAuthenticationDefaults.LogoutPath);
var url = DictHelper.RetrieveHomeUrl(model.AppCode);
return url.Equals("~/Home/Index", System.StringComparison.OrdinalIgnoreCase) ? (IActionResult)View(model) : Redirect(url);
}
/// <summary>
/// Error View
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[AllowAnonymous]
public IActionResult Error(int? id = 0)
public IActionResult Error(int id)
{
var model = ErrorModel.CreateById(id ?? 0);
var model = ErrorModel.CreateById(id);
if (id != 403)
{
var returnUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].ToString();

View File

@ -0,0 +1,22 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build
WORKDIR /src
COPY src/admin .
WORKDIR "/src/Bootstrap.Admin"
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "."]
COPY --from=publish ["/src/keys/Longbow.lic", "."]
COPY --from=publish ["/src/keys/appsettings.Production.json", "."]
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]

View File

@ -1,15 +1,11 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using Task = System.Threading.Tasks.Task;
@ -23,7 +19,7 @@ namespace Bootstrap.Admin.HealthChecks
{
private readonly IConfiguration _configuration;
private readonly IHttpContextAccessor _httpContextAccessor;
private static readonly Func<IConfiguration, string, string?> ConnectionStringResolve = (c, name) => string.IsNullOrEmpty(name)
private static readonly Func<IConfiguration, string, string> ConnectionStringResolve = (c, name) => string.IsNullOrEmpty(name)
? c.GetSection("ConnectionStrings").GetChildren().FirstOrDefault()?.Value
: c.GetConnectionString(name);
@ -47,13 +43,13 @@ namespace Bootstrap.Admin.HealthChecks
public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
{
var db = _configuration.GetSection("DB").GetChildren()
.Select(config => new DbOption()
.Select(config => new
{
Enabled = bool.TryParse(config["Enabled"], out var en) ? en : false,
ProviderName = config["ProviderName"],
Widget = config["Widget"],
ConnectionString = ConnectionStringResolve(config.GetSection("ConnectionStrings").Exists() ? config : _configuration, string.Empty)
}).FirstOrDefault(i => i.Enabled) ?? new DbOption()
}).FirstOrDefault(i => i.Enabled) ?? new
{
Enabled = true,
ProviderName = Longbow.Data.DatabaseProviderType.SqlServer.ToString(),
@ -62,31 +58,23 @@ namespace Bootstrap.Admin.HealthChecks
};
// 检查 当前用户 账户权限
var loginUser = _httpContextAccessor.HttpContext?.User.Identity?.Name;
var loginUser = _httpContextAccessor.HttpContext.User.Identity.Name;
var userName = loginUser ?? "Admin";
var dictsCount = 0;
var menusCount = 0;
var roles = string.Empty;
var displayName = string.Empty;
var healths = false;
Exception? error = null;
Exception error = null;
try
{
var user = UserHelper.RetrieveUserByUserName(userName);
displayName = user?.DisplayName ?? string.Empty;
DbContextManager.Exception = null;
var user = UserHelper.RetrieveUserByUserName(new GenericIdentity(userName));
displayName = user?.DisplayName;
roles = string.Join(",", RoleHelper.RetrievesByUserName(userName) ?? new string[0]);
menusCount = MenuHelper.RetrieveMenusByUserName(userName)?.Count() ?? 0;
dictsCount = DictHelper.RetrieveDicts()?.Count() ?? 0;
healths = user != null && !string.IsNullOrEmpty(roles) && menusCount > 0 && dictsCount > 0;
// 检查数据库是否可写
var dict = new BootstrapDict()
{
Category = "DB-Check",
Name = "WriteTest",
Code = "1"
};
if (DictHelper.Save(dict) && !string.IsNullOrEmpty(dict.Id)) DictHelper.Delete(new string[] { dict.Id });
}
catch (Exception ex)
{
@ -94,45 +82,30 @@ namespace Bootstrap.Admin.HealthChecks
}
var data = new Dictionary<string, object>()
{
{ "ConnectionString", db.ConnectionString ?? string.Empty },
{ "Reference", DbContextManager.Create<Dict>()?.GetType().Assembly.FullName ?? db.Widget ?? string.Empty },
{ "DbType", db?.ProviderName ?? string.Empty },
{ "ConnectionString", db.ConnectionString },
{ "Reference", DbContextManager.Create<Dict>()?.GetType().Assembly.FullName ?? db.Widget },
{ "DbType", db?.ProviderName },
{ "Dicts", dictsCount },
{ "LoginName", userName },
{ "LoginName", loginUser },
{ "DisplayName", displayName },
{ "Roles", roles },
{ "Navigations", menusCount }
};
if (string.IsNullOrEmpty(db?.ConnectionString))
if (string.IsNullOrEmpty(db.ConnectionString))
{
// 未启用连接字符串
data["ConnectionString"] = "未配置数据库连接字符串";
return Task.FromResult(HealthCheckResult.Unhealthy("Error", null, data));
}
if (DbContextManager.Exception != null) error = DbContextManager.Exception;
if (error != null)
if (error != null || DbContextManager.Exception != null)
{
data.Add("Exception", error.Message);
if (error.Message.Contains("SQLite Error 8: 'attempt to write a readonly database'.")) data.Add("解决办法", "更改数据库文件为可读,并授予进程可写权限");
if (error.Message.Contains("Could not load", StringComparison.OrdinalIgnoreCase)) data.Add("解决办法", "Nuget 引用相对应的数据库驱动 dll");
// UNDONE: Json 序列化循环引用导致异常 NET 5.0 修复此问题
// 目前使用 new Exception() 临时解决
return Task.FromResult(HealthCheckResult.Unhealthy("Error", new Exception(error.Message), data));
data.Add("Exception", (DbContextManager.Exception ?? error).Message);
return Task.FromResult(HealthCheckResult.Unhealthy("Error", error ?? DbContextManager.Exception, data));
}
return healths ? Task.FromResult(HealthCheckResult.Healthy("Ok", data)) : Task.FromResult(HealthCheckResult.Degraded("Failed", null, data));
}
private class DbOption
{
public bool Enabled { get; set; }
public string? ProviderName { get; set; }
public string? Widget { get; set; }
public string? ConnectionString { get; set; }
}
}
}

View File

@ -1,7 +1,3 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using System;
using System.Net.Http;

View File

@ -1,14 +1,10 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http.Json;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@ -28,7 +24,7 @@ namespace Bootstrap.Admin.HealthChecks
public GiteeHttpHealthCheck(GiteeHttpClient client, IHttpContextAccessor accessor)
{
_client = client;
_client.HttpClient.BaseAddress = new Uri($"{accessor.HttpContext!.Request.Scheme}://{accessor.HttpContext?.Request.Host}{accessor.HttpContext?.Request.PathBase}");
_client.HttpClient.BaseAddress = new Uri($"{accessor.HttpContext.Request.Scheme}://{accessor.HttpContext.Request.Host}{accessor.HttpContext.Request.PathBase}");
}
/// <summary>
@ -45,18 +41,11 @@ namespace Bootstrap.Admin.HealthChecks
Task.WaitAll(urls.Select(url => Task.Run(async () =>
{
var sw = Stopwatch.StartNew();
Exception? error = null;
object? result = null;
try
{
result = await _client.HttpClient.GetFromJsonAsync<object>($"/api/Gitee/{url}", cancellationToken);
}
catch (Exception ex) { error = ex; }
Exception error = null;
var result = await _client.HttpClient.GetAsJsonAsync<object>($"/api/Gitee/{url}", ex => error = ex, cancellationToken);
sw.Stop();
data.Add(url, error == null
? $"{result} Elapsed: {sw.Elapsed}"
: $"Elapsed: {sw.Elapsed} Exception: {error}");
})).ToArray(), cancellationToken);
data.Add(url, error == null ? $"{result} Elapsed: {sw.Elapsed}" : $"{result} Elapsed: {sw.Elapsed} Exception: {error}");
})).ToArray());
return Task.FromResult(HealthCheckResult.Healthy("Ok", data));
}
}

View File

@ -1,8 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.Admin.HealthChecks;
using Bootstrap.Admin.HealthChecks;
using Microsoft.Extensions.Configuration;
namespace Microsoft.Extensions.DependencyInjection

View File

@ -0,0 +1,35 @@
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using Operation = Swashbuckle.AspNetCore.Swagger.Operation;
namespace Bootstrap.Admin
{
/// <summary>
///
/// </summary>
public class HttpHeaderOperation : IOperationFilter
{
/// <summary>
///
/// </summary>
/// <param name="operation"></param>
/// <param name="context"></param>
public void Apply(Operation operation, OperationFilterContext context)
{
if (operation.Parameters == null) operation.Parameters = new List<IParameter>();
if (context.MethodInfo.GetCustomAttributes(typeof(AllowAnonymousAttribute), true).Length == 0)
{
operation.Parameters.Add(new NonBodyParameter()
{
Name = "Authorization", //添加Authorization头部参数
In = "header",
Type = "string",
Required = false
});
}
}
}
}

View File

@ -1,19 +1,22 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY . .
COPY src/admin .
WORKDIR "src/admin/Bootstrap.Admin"
WORKDIR "/src/Bootstrap.Admin"
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "."]
COPY --from=publish ["/src/keys/Longbow.lic", "."]
COPY --from=publish ["/src/keys/appsettings.Production.json", "."]
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]

View File

@ -1,13 +1,9 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
namespace Bootstrap.Admin.Models
namespace Bootstrap.Admin.Models
{
/// <summary>
///
/// </summary>
public class ErrorModel : ModelBase
public class ErrorModel
{
/// <summary>
///
@ -17,28 +13,28 @@ namespace Bootstrap.Admin.Models
/// <summary>
///
/// </summary>
public string Title { get; set; } = "";
public string Title { get; set; }
/// <summary>
///
/// </summary>
public string Content { get; set; } = "";
public string Content { get; set; }
/// <summary>
///
/// </summary>
public string Image { get; set; } = "";
public string Image { get; set; }
/// <summary>
///
/// </summary>
public string Detail { get; set; } = "";
public string Detail { get; set; }
/// <summary>
///
/// </summary>
public string ReturnUrl { get; set; } = "";
public string ReturnUrl { get; set; }
/// <summary>
///

View File

@ -0,0 +1,60 @@
using Bootstrap.DataAccess;
using System;
using System.Security.Principal;
namespace Bootstrap.Admin.Models
{
/// <summary>
///
/// </summary>
public class HeaderBarModel : ModelBase
{
/// <summary>
///
/// </summary>
/// <param name="identity"></param>
public HeaderBarModel(IIdentity identity)
{
var user = UserHelper.RetrieveUserByUserName(identity);
if (user != null)
{
Icon = user.Icon.Contains("://", StringComparison.OrdinalIgnoreCase) ? user.Icon : string.Format("{0}{1}", DictHelper.RetrieveIconFolderPath(), user.Icon);
DisplayName = user.DisplayName;
UserName = user.UserName;
AppCode = user.App;
Css = user.Css;
ActiveCss = string.IsNullOrEmpty(Css) ? Theme : Css;
}
}
/// <summary>
///
/// </summary>
public string UserName { get; }
/// <summary>
///
/// </summary>
public string DisplayName { get; }
/// <summary>
/// 获得/设置 用户头像地址
/// </summary>
public string Icon { get; }
/// <summary>
/// 获取/设置 个人网站样式
/// </summary>
public string Css { get; }
/// <summary>
/// 获得 当前设置的默认应用
/// </summary>
public string AppCode { get; }
/// <summary>
/// 获得 当前样式
/// </summary>
public string ActiveCss { get; }
}
}

View File

@ -1,6 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Microsoft.AspNetCore.Mvc;
namespace Bootstrap.Admin.Models
{
@ -12,8 +10,8 @@ namespace Bootstrap.Admin.Models
/// <summary>
/// 构造函数
/// </summary>
/// <param name="userName"></param>
public LockModel(string? userName) : base(userName)
/// <param name="controller"></param>
public LockModel(ControllerBase controller) : base(controller.User.Identity)
{
}
@ -21,11 +19,11 @@ namespace Bootstrap.Admin.Models
/// <summary>
/// 获得/设置 返回路径
/// </summary>
public string? ReturnUrl { get; set; }
public string ReturnUrl { get; set; }
/// <summary>
/// 获得/设置 认证方式 Cookie Mobile Gitee GitHub
/// </summary>
public string? AuthenticationType { get; set; }
public string AuthenticationType { get; set; }
}
}

View File

@ -1,21 +1,16 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
namespace Bootstrap.Admin.Models
{
/// <summary>
/// 登陆页面 Model
/// </summary>
public class LoginModel : AdminModel
public class LoginModel : ModelBase
{
/// <summary>
/// 默认构造函数
/// </summary>
/// <param name="appId"></param>
public LoginModel(string? appId = null) : base(appId)
public LoginModel()
{
ImageLibUrl = DictHelper.RetrieveImagesLibUrl();
}

View File

@ -1,8 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
namespace Bootstrap.Admin.Models
namespace Bootstrap.Admin.Models
{
/// <summary>
///

View File

@ -1,49 +1,40 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Bootstrap.DataAccess;
using Bootstrap.Security.Mvc;
using Bootstrap.DataAccess;
namespace Bootstrap.Admin.Models
{
/// <summary>
/// AdminModel 实体
/// ModelBase 基础类
/// </summary>
public class AdminModel : ModelBase
public class ModelBase
{
/// <summary>
/// 默认构造函数
/// </summary>
/// <param name="appId"></param>
public AdminModel(string? appId = null)
public ModelBase()
{
if (string.IsNullOrEmpty(appId)) appId = BootstrapAppContext.AppId;
Title = DictHelper.RetrieveWebTitle(appId);
Footer = DictHelper.RetrieveWebFooter(appId);
Title = DictHelper.RetrieveWebTitle();
Footer = DictHelper.RetrieveWebFooter();
Theme = DictHelper.RetrieveActiveTheme();
IsDemo = DictHelper.RetrieveSystemModel();
ShowCardTitle = DictHelper.RetrieveCardTitleStatus();
ShowSideBar = DictHelper.RetrieveSidebarStatus();
ShowCardTitle = DictHelper.RetrieveCardTitleStatus() ? "" : "no-card-header";
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "collapsed";
AllowMobile = DictHelper.RetrieveMobileLogin();
AllowOAuth = DictHelper.RetrieveOAuthLogin();
ShowMobile = AllowMobile;
ShowOAuth = AllowOAuth;
ShowMobile = AllowMobile ? "" : "mobile";
ShowOAuth = AllowOAuth ? "" : "oauth";
LockScreenPeriod = DictHelper.RetrieveAutoLockScreenPeriod();
EnableAutoLockScreen = DictHelper.RetrieveAutoLockScreen();
FixedTableHeader = DictHelper.RetrieveFixedTableHeader();
}
/// <summary>
/// 获取 网站标题
/// </summary>
public string Title { get; protected set; }
public string Title { get; private set; }
/// <summary>
/// 获取 网站页脚
/// </summary>
public string Footer { get; protected set; }
public string Footer { get; private set; }
/// <summary>
/// 网站样式全局设置
@ -58,12 +49,12 @@ namespace Bootstrap.Admin.Models
/// <summary>
/// 是否显示卡片标题
/// </summary>
public bool ShowCardTitle { get; protected set; }
public string ShowCardTitle { get; protected set; }
/// <summary>
/// 是否收缩侧边栏
/// </summary>
public bool ShowSideBar { get; protected set; }
public string ShowSideBar { get; protected set; }
/// <summary>
/// 获得 是否允许短信验证码登录
@ -78,12 +69,12 @@ namespace Bootstrap.Admin.Models
/// <summary>
/// 获得 是否允许短信验证码登录
/// </summary>
public bool ShowMobile { get; }
public string ShowMobile { get; }
/// <summary>
/// 获得 是否允许第三方 OAuth 认证登录
/// </summary>
public bool ShowOAuth { get; }
public string ShowOAuth { get; }
/// <summary>
/// 获得 自动锁屏时长 默认 1 分钟 字典表中配置
@ -94,10 +85,5 @@ namespace Bootstrap.Admin.Models
/// 获得 自动锁屏功能是否自动开启 默认关闭
/// </summary>
public bool EnableAutoLockScreen { get; }
/// <summary>
/// 获得 是否固定表头
/// </summary>
public bool FixedTableHeader { get; }
}
}

View File

@ -0,0 +1,36 @@
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.Admin.Models
{
/// <summary>
///
/// </summary>
public class NavigatorBarModel : HeaderBarModel
{
/// <summary>
///
/// </summary>
/// <param name="controller"></param>
public NavigatorBarModel(ControllerBase controller) : base(controller.User.Identity)
{
Navigations = MenuHelper.RetrieveSystemMenus(UserName, $"~{controller.HttpContext.Request.Path}");
var authApps = AppHelper.RetrievesByUserName(controller.User.Identity.Name);
Applications = DictHelper.RetrieveApps().Where(app => app.Key == "0" || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase)));
}
/// <summary>
///
/// </summary>
public IEnumerable<BootstrapMenu> Navigations { get; private set; }
/// <summary>
///
/// </summary>
public IEnumerable<KeyValuePair<string, string>> Applications { get; private set; }
}
}

View File

@ -1,9 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using System.IO;
using System.Linq;
@ -11,7 +6,7 @@ using System.Linq;
namespace Bootstrap.Admin.Models
{
/// <summary>
/// 个人中心模型
///
/// </summary>
public class ProfilesModel : SettingsModel
{
@ -23,25 +18,19 @@ namespace Bootstrap.Admin.Models
/// <summary>
/// 获得 头像文件名称
/// </summary>
public string FileName { get; } = "";
public string FileName { get; }
/// <summary>
/// 获得 是否为第三方用户
/// </summary>
/// <remarks>第三方用户不允许修改密码</remarks>
public bool External { get; }
/// <summary>
/// 获得 当前用户默认应用程序名称
/// </summary>
public string AppName { get; }
/// <summary>
/// 构造函数
///
/// </summary>
/// <param name="host"></param>
/// <param name="controller"></param>
public ProfilesModel(ControllerBase controller, IWebHostEnvironment host) : base(controller)
public ProfilesModel(ControllerBase controller, IHostingEnvironment host) : base(controller)
{
if (host != null)
{
@ -49,17 +38,14 @@ namespace Bootstrap.Admin.Models
// 数据库存储的个人图片有后缀 default.jpg?v=1234567
fileName = fileName.Split('?').FirstOrDefault();
if (!string.IsNullOrEmpty(fileName) && File.Exists(fileName))
if (File.Exists(fileName))
{
Size = new FileInfo(fileName).Length;
FileName = Path.GetFileName(fileName);
}
}
if (controller.User.Identity!.AuthenticationType != CookieAuthenticationDefaults.AuthenticationScheme) External = true;
// 设置 当前用户默认应用名称
AppName = Applications.FirstOrDefault(app => app.Key == AppId).Value;
if (controller.User.Identity.AuthenticationType != Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationDefaults.AuthenticationScheme) External = true;
}
}
}

View File

@ -0,0 +1,33 @@
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Models
{
/// <summary>
/// 网站设置 Model 实体类
/// </summary>
public class SettingsModel : NavigatorBarModel
{
/// <summary>
///
/// </summary>
/// <param name="controller"></param>
public SettingsModel(ControllerBase controller) : base(controller)
{
Themes = DictHelper.RetrieveThemes();
AutoLockScreen = EnableAutoLockScreen ? "" : "lockScreen";
}
/// <summary>
/// 获得 系统配置的所有样式表
/// </summary>
public IEnumerable<BootstrapDict> Themes { get; }
/// <summary>
/// 获得 是否开启自动锁屏
/// </summary>
public string AutoLockScreen { get; }
}
}

View File

@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Models
{
/// <summary>
///
/// </summary>
public class TaskModel : NavigatorBarModel
{
/// <summary>
///
/// </summary>
/// <param name="controller"></param>
public TaskModel(ControllerBase controller) : base(controller)
{
Tasks = new string[] { "测试任务" };
}
/// <summary>
/// 获得 系统配置的所有任务
/// </summary>
public IEnumerable<string> Tasks { get; }
}
}

View File

@ -0,0 +1,27 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace Bootstrap.Admin
{
/// <summary>
///
/// </summary>
public class Program
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
/// <summary>
///
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args).UseSentry().UseStartup<Startup>();
}
}

View File

@ -16,11 +16,6 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}"
},
"Bootstrap.Admin": {
"commandName": "Project",
"launchBrowser": true,
@ -28,6 +23,11 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:50852/"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}"
}
}
}

Some files were not shown because too many files have changed in this diff Show More