修改BUG:SQLServer 导致后台页面无法打开 closed #IUW7V

#Issue
https://gitee.com/LongbowEnterprise/dashboard/issues?id=IUW7V
#Comment
DBCC CHECKIDENT(Navigations, RESEED, 0) 语句导致主键ID为0,层次菜单方法进入死循环
This commit is contained in:
Argo Zhang 2019-04-01 14:44:49 +08:00
parent 5e94c74f84
commit 5e662e5909
4 changed files with 53 additions and 68 deletions

View File

@ -7,7 +7,7 @@ SET IDENTITY_INSERT [dbo].[Users] ON
insert into Users (ID, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, [Description]) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', GetDate(), GetDate(), 'system', N'系统默认创建') insert into Users (ID, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, [Description]) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', GetDate(), GetDate(), 'system', N'系统默认创建')
SET IDENTITY_INSERT [dbo].[Users] OFF SET IDENTITY_INSERT [dbo].[Users] OFF
DELETE From Dicts 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'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'1', 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', 0)
@ -45,8 +45,7 @@ INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设
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'JuheIPSvr', 'http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=', 0)
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'演示系统', '0', 0) INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'演示系统', '0', 0)
DELETE FROM Navigations DELETE FROM Navigations Where Category = N'0'
DBCC CHECKIDENT(Navigations, RESEED, 0)
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'后台管理', 10, N'fa fa-gear', N'~/Admin/Index', N'0') INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'后台管理', 10, N'fa fa-gear', N'~/Admin/Index', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'个人中心', 20, N'fa fa-suitcase', N'~/Admin/Profiles', N'0') INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'个人中心', 20, N'fa fa-suitcase', N'~/Admin/Profiles', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2); INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
@ -117,26 +116,17 @@ INSERT [dbo].[Roles] ([ID], [RoleName], [Description]) VALUES (1, N'Administrato
INSERT [dbo].[Roles] ([ID], [RoleName], [Description]) VALUES (2, N'Default', N'默认用户,可访问前台页面') INSERT [dbo].[Roles] ([ID], [RoleName], [Description]) VALUES (2, N'Default', N'默认用户,可访问前台页面')
SET IDENTITY_INSERT [dbo].[Roles] OFF SET IDENTITY_INSERT [dbo].[Roles] OFF
DELETE FROM RoleGroup DELETE FROM RoleGroup Where RoleID = 1
INSERT [dbo].[RoleGroup] ([RoleID], [GroupID]) VALUES (1, 1) INSERT [dbo].[RoleGroup] ([RoleID], [GroupID]) VALUES (1, 1)
DELETE FROM UserGroup DELETE FROM UserGroup Where UserID = 1
INSERT [dbo].[UserGroup] ([UserID], [GroupID]) VALUES (1, 1) INSERT [dbo].[UserGroup] ([UserID], [GroupID]) VALUES (1, 1)
DELETE FROM UserRole DELETE FROM UserRole Where UserID = 1
INSERT [dbo].[UserRole] ([UserID], [RoleID]) VALUES (1, 1) INSERT [dbo].[UserRole] ([UserID], [RoleID]) VALUES (1, 1)
INSERT [dbo].[UserRole] ([UserID], [RoleID]) VALUES (1, 2) INSERT [dbo].[UserRole] ([UserID], [RoleID]) VALUES (1, 2)
DELETE FROM NavigationRole DELETE FROM NavigationRole
INSERT INTO NavigationRole SELECT id, 1 FROM navigations
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (1, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (2, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (3, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (10, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (16, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (17, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (18, 2)
INSERT [dbo].[NavigationRole] ([NavigationID], [RoleID]) VALUES (19, 2)
-- Client Data -- Client Data
Declare @AppId nvarchar(1) Declare @AppId nvarchar(1)
@ -156,12 +146,10 @@ Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统设置地
-- 菜单 -- 菜单
DELETE FROM Navigations Where [Application] = @AppId DELETE FROM Navigations Where [Application] = @AppId
SET IDENTITY_INSERT [dbo].[Navigations] ON INSERT [dbo].[Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, N'首页', 10, N'fa fa-fa', N'~/Home/Index', N'1', @AppId)
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (210, 0, N'首页', 10, N'fa fa-fa', N'~/Home/Index', N'1', @AppId)
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (220, 0, N'测试页面', 10, N'fa fa-fa', N'~/Home/Index', N'1', @AppId) INSERT [dbo].[Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, N'测试页面', 10, N'fa fa-fa', N'~/Home/Index', N'1', @AppId)
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (230, 220, N'关于', 10, N'fa fa-fa', N'~/Home/Index', N'1', @AppId) INSERT [dbo].[Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (@@Identity, N'关于', 10, N'fa fa-fa', N'~/Home/Index', N'1', @AppId)
SET IDENTITY_INSERT [dbo].[Navigations] OFF
-- 菜单授权 -- 菜单授权
DELETE FROM NavigationRole Where NavigationID in (Select ID From Navigations Where [Application] = @AppId) DELETE FROM NavigationRole Where NavigationID in (Select ID From Navigations Where [Application] = @AppId)

View File

@ -4,29 +4,29 @@ ALTER TABLE Users MODIFY COLUMN ID INT NOT NULL;
INSERT INTO Users (ID, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, Description) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', now(), now(), 'system', '系统默认创建'); INSERT INTO Users (ID, UserName, Password, PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, Description) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', now(), now(), 'system', '系统默认创建');
ALTER TABLE Users MODIFY COLUMN ID INT NOT NULL AUTO_INCREMENT; ALTER TABLE Users MODIFY COLUMN ID INT NOT NULL AUTO_INCREMENT;
DELETE From Dicts; DELETE From Dicts Where Define = 0;
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '菜单', '系统菜单', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('菜单', '系统菜单', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '菜单', '外部菜单', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('菜单', '外部菜单', '1', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '应用程序', '未设置', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '未设置', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '网站设置', '网站标题', '后台管理系统', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '网站标题', '后台管理系统', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '网站设置', '网站页脚', '2016 © 通用后台管理系统', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '网站页脚', '2016 © 通用后台管理系统', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '系统通知', '用户注册', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统通知', '用户注册', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '系统通知', '程序异常', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统通知', '程序异常', '1', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '系统通知', '数据库连接', '2', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统通知', '数据库连接', '2', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '通知状态', '未处理', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('通知状态', '未处理', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '通知状态', '已处理', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('通知状态', '已处理', '1', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '处理结果', '同意', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('处理结果', '同意', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '处理结果', '拒绝', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('处理结果', '拒绝', '1', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '消息状态', '未读', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('消息状态', '未读', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '消息状态', '已读', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('消息状态', '已读', '1', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '消息标签', '一般', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('消息标签', '一般', '0', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '消息标签', '紧要', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('消息标签', '紧要', '1', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '头像地址', '头像路径', '~/images/uploader/', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('头像地址', '头像路径', '~/images/uploader/', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '头像地址', '头像文件', 'default.jpg', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('头像地址', '头像文件', 'default.jpg', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '网站样式', '蓝色样式', 'blue.css', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', '蓝色样式', 'blue.css', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '网站样式', '黑色样式', 'black.css', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站样式', '黑色样式', 'black.css', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '当前样式', '使用样式', 'blue.css', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('当前样式', '使用样式', 'blue.css', 0);
INSERT INTO Dicts (ID, Category, Name, Code, Define) VALUES (NULL, '网站设置', '前台首页', '~/Home/Index', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('网站设置', '前台首页', '~/Home/Index', 0);
-- 时长单位 月 -- 时长单位 月
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '程序异常保留时长', '1', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '程序异常保留时长', '1', 0);
@ -42,8 +42,7 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'BaiDuI
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 ('系统设置', '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 ('系统设置', '演示系统', '0', 0);
DELETE FROM Navigations; DELETE FROM Navigations Where Category = '0';
Truncate Navigations;
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0'); INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0'); INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2); INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
@ -114,13 +113,13 @@ INSERT INTO Roles (ID, RoleName, Description) VALUES (1, 'Administrators', '系
INSERT INTO Roles (ID, RoleName, Description) VALUES (2, 'Default', '默认用户,可访问前台页面'); INSERT INTO Roles (ID, RoleName, Description) VALUES (2, 'Default', '默认用户,可访问前台页面');
ALTER TABLE Roles MODIFY COLUMN ID INT NOT NULL AUTO_INCREMENT; ALTER TABLE Roles MODIFY COLUMN ID INT NOT NULL AUTO_INCREMENT;
DELETE FROM RoleGroup; DELETE FROM RoleGroup Where RoleID = 1;
INSERT INTO RoleGroup (RoleID, GroupID) VALUES (1, 1); INSERT INTO RoleGroup (RoleID, GroupID) VALUES (1, 1);
DELETE FROM UserGroup; DELETE FROM UserGroup Where UserID = 1;
INSERT INTO UserGroup (UserID, GroupID) VALUES (1, 1); INSERT INTO UserGroup (UserID, GroupID) VALUES (1, 1);
DELETE FROM UserRole; DELETE FROM UserRole Where UserID = 1;
INSERT INTO UserRole (UserID, RoleID) VALUES (1, 1); INSERT INTO UserRole (UserID, RoleID) VALUES (1, 1);
INSERT INTO UserRole (UserID, RoleID) VALUES (1, 2); INSERT INTO UserRole (UserID, RoleID) VALUES (1, 2);
@ -138,10 +137,10 @@ Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '个人
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/Index', 1);
Delete from Navigations where Application = 2; Delete from Navigations where Application = 2;
INSERT into Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (NULL, 0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2); INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
INSERT into Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (NULL, 0, '测试页面', 20, 'fa fa-fa', '#', '1', 2); INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '测试页面', 20, 'fa fa-fa', '#', '1', 2);
INSERT into Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (NULL, @@identity, '关于', 10, 'fa fa-fa', '~/Home/About', '1', 2); INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (@@identity, '关于', 10, 'fa fa-fa', '~/Home/About', '1', 2);
-- 菜单授权 -- 菜单授权
DELETE FROM NavigationRole Where NavigationID in (Select ID From Navigations Where Application = 2); DELETE FROM NavigationRole Where NavigationID in (Select ID From Navigations Where Application = 2);

View File

@ -3,8 +3,7 @@ DELETE From Users;
ALTER SEQUENCE users_id_seq RESTART WITH 1; ALTER SEQUENCE users_id_seq RESTART WITH 1;
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) values ('Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', now(), now(), 'system', '系统默认创建');
DELETE From Dicts; DELETE From Dicts Where Define = 0;
ALTER SEQUENCE dicts_id_seq RESTART WITH 1;
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('菜单', '系统菜单', '0', 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 ('菜单', '外部菜单', '1', 0);
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '未设置', '0', 0); INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('应用程序', '未设置', '0', 0);
@ -42,8 +41,7 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'BaiDuI
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 ('系统设置', '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 ('系统设置', '演示系统', '0', 0);
DELETE FROM Navigations; DELETE FROM Navigations Where Category = '0';
ALTER SEQUENCE navigations_id_seq RESTART WITH 1;
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0'); INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0'); INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2); INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
@ -103,22 +101,22 @@ INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (c
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 2, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0'); INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 2, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 3, '图标集', 10, 'fa fa-dashboard', '~/Admin/FAIcon', '0'); INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 3, '图标集', 10, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
DELETE FROM Groups; DELETE FROM Groups Where ID = 1;
ALTER SEQUENCE groups_id_seq RESTART WITH 1; ALTER SEQUENCE groups_id_seq RESTART WITH 1;
INSERT INTO Groups (ID, GroupName, Description) VALUES (1, 'Admin', '系统默认组'); INSERT INTO Groups (ID, GroupName, Description) VALUES (1, 'Admin', '系统默认组');
DELETE FROM Roles; DELETE FROM Roles Where ID in (1, 2);
ALTER SEQUENCE roles_id_seq RESTART WITH 1; ALTER SEQUENCE roles_id_seq RESTART WITH 1;
INSERT INTO Roles (RoleName, Description) VALUES ('Administrators', '系统管理员'); INSERT INTO Roles (RoleName, Description) VALUES ('Administrators', '系统管理员');
INSERT INTO Roles (RoleName, Description) VALUES ('Default', '默认用户,可访问前台页面'); INSERT INTO Roles (RoleName, Description) VALUES ('Default', '默认用户,可访问前台页面');
DELETE FROM RoleGroup; DELETE FROM RoleGroup Where RoleID = 1;
INSERT INTO RoleGroup (RoleID, GroupID) VALUES (1, 1); INSERT INTO RoleGroup (RoleID, GroupID) VALUES (1, 1);
DELETE FROM UserGroup; DELETE FROM UserGroup Where UserID = 1;
INSERT INTO UserGroup (UserID, GroupID) VALUES (1, 1); INSERT INTO UserGroup (UserID, GroupID) VALUES (1, 1);
DELETE FROM UserRole; DELETE FROM UserRole Where UserID = 1;
INSERT INTO UserRole (UserID, RoleID) VALUES (1, 1); INSERT INTO UserRole (UserID, RoleID) VALUES (1, 1);
INSERT INTO UserRole (UserID, RoleID) VALUES (1, 2); INSERT INTO UserRole (UserID, RoleID) VALUES (1, 2);

View File

@ -2,7 +2,7 @@ DELETE From Users where ID = 1;
-- ADMIN/123789 -- ADMIN/123789
INSERT INTO Users (ID, UserName, [Password], PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, [Description]) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', datetime(CURRENT_TIMESTAMP, 'localtime'), datetime(CURRENT_TIMESTAMP, 'localtime'), 'system', '系统默认创建'); INSERT INTO Users (ID, UserName, [Password], PassSalt, DisplayName, RegisterTime, ApprovedTime,ApprovedBy, [Description]) values (1, 'Admin', 'Es7WVgNsJuELwWK8daCqufUBknCsSC0IYDphQZAiGOo=', 'W5vpBEOYRGHkQXatN0t+ECM/U8cHDuEgrq56+zZBk4J481xH', 'Administrator', datetime(CURRENT_TIMESTAMP, 'localtime'), datetime(CURRENT_TIMESTAMP, 'localtime'), 'system', '系统默认创建');
DELETE From Dicts; DELETE From Dicts Where Define = 0;
INSERT INTO [Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (NULL, '菜单', '系统菜单', '0', 0); INSERT INTO [Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (NULL, '菜单', '系统菜单', '0', 0);
INSERT INTO [Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (NULL, '菜单', '外部菜单', '1', 0); INSERT INTO [Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (NULL, '菜单', '外部菜单', '1', 0);
INSERT INTO [Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (NULL, '应用程序', '未设置', '0', 0); INSERT INTO [Dicts] ([ID], [Category], [Name], [Code], [Define]) VALUES (NULL, '应用程序', '未设置', '0', 0);
@ -40,7 +40,7 @@ INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置
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 ('系统设置', '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 ('系统设置', '演示系统', '0', 0);
DELETE FROM Navigations; DELETE FROM Navigations Where Category = '0';
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0'); INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0'); INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2); INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
@ -107,13 +107,13 @@ DELETE FROM Roles where ID in (1, 2);
INSERT INTO [Roles] ([ID], [RoleName], [Description]) VALUES (1, 'Administrators', '系统管理员'); INSERT INTO [Roles] ([ID], [RoleName], [Description]) VALUES (1, 'Administrators', '系统管理员');
INSERT INTO [Roles] ([ID], [RoleName], [Description]) VALUES (2, 'Default', '默认用户,可访问前台页面'); INSERT INTO [Roles] ([ID], [RoleName], [Description]) VALUES (2, 'Default', '默认用户,可访问前台页面');
DELETE FROM RoleGroup; DELETE FROM RoleGroup Where RoleID = 1;
INSERT INTO [RoleGroup] ([RoleID], [GroupID]) VALUES (1, 1); INSERT INTO [RoleGroup] ([RoleID], [GroupID]) VALUES (1, 1);
DELETE FROM UserGroup; DELETE FROM UserGroup Where UserID = 1;
INSERT INTO [UserGroup] ([UserID], [GroupID]) VALUES (1, 1); INSERT INTO [UserGroup] ([UserID], [GroupID]) VALUES (1, 1);
DELETE FROM UserRole; DELETE FROM UserRole Where UserID = 1;
INSERT INTO [UserRole] ([UserID], [RoleID]) VALUES (1, 1); INSERT INTO [UserRole] ([UserID], [RoleID]) VALUES (1, 1);
INSERT INTO [UserRole] ([UserID], [RoleID]) VALUES (1, 2); INSERT INTO [UserRole] ([UserID], [RoleID]) VALUES (1, 2);
@ -131,10 +131,10 @@ Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '个
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/Index', 1);
Delete from [Navigations] where Application = 2; Delete from [Navigations] where Application = 2;
INSERT into [Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (NULL, 0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2); INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
INSERT into [Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (NULL, 0, '测试页面', 20, 'fa fa-fa', '#', '1', 2); INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '测试页面', 20, 'fa fa-fa', '#', '1', 2);
INSERT into [Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (NULL, last_insert_rowid(), '关于', 10, 'fa fa-fa', '~/Home/About', '1', 2); INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (last_insert_rowid(), '关于', 10, 'fa fa-fa', '~/Home/About', '1', 2);
-- 菜单授权 -- 菜单授权
DELETE FROM NavigationRole Where NavigationID in (Select ID From Navigations Where [Application] = 2); DELETE FROM NavigationRole Where NavigationID in (Select ID From Navigations Where [Application] = 2);