parent
b3eca9de06
commit
f03b4700f2
|
@ -149,6 +149,17 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
return DBAccess.GetCollection<DataAccess.Trace>("Traces");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static IMongoCollection<RejectUser> RejectUsers
|
||||
{
|
||||
get
|
||||
{
|
||||
return DBAccess.GetCollection<RejectUser>("RejectUsers");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private static void InitDb()
|
||||
|
@ -161,6 +172,13 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
{
|
||||
BsonSerializer.RegisterSerializer(DateTimeSerializer.LocalInstance);
|
||||
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(Dict)))
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<Dict>(md =>
|
||||
{
|
||||
md.AutoMap();
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(BootstrapDict)))
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<BootstrapDict>(md =>
|
||||
|
@ -168,6 +186,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
md.AutoMap();
|
||||
md.IdMemberMap.SetSerializer(new StringSerializer(BsonType.ObjectId));
|
||||
md.IdMemberMap.SetIgnoreIfDefault(true);
|
||||
md.AddKnownType(typeof(Dict));
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.User)))
|
||||
|
@ -244,6 +263,13 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
md.UnmapMember(ex => ex.Period);
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.Log)))
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<DataAccess.Log>(md =>
|
||||
{
|
||||
md.AutoMap();
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.Trace)))
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<DataAccess.Trace>(md =>
|
||||
|
@ -251,14 +277,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
md.AutoMap();
|
||||
md.IdMemberMap.SetSerializer(new StringSerializer(BsonType.ObjectId));
|
||||
md.IdMemberMap.SetIgnoreIfDefault(true);
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.Log)))
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<DataAccess.Log>(md =>
|
||||
{
|
||||
md.AutoMap();
|
||||
md.AddKnownType(typeof(DataAccess.Trace));
|
||||
md.AddKnownType(typeof(DataAccess.Log));
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.LoginUser)))
|
||||
|
@ -279,6 +298,15 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
md.IdMemberMap.SetIgnoreIfDefault(true);
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(RejectUser)))
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<RejectUser>(md =>
|
||||
{
|
||||
md.AutoMap();
|
||||
md.IdMemberMap.SetSerializer(new StringSerializer(BsonType.ObjectId));
|
||||
md.IdMemberMap.SetIgnoreIfDefault(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <returns></returns>
|
||||
public override bool Save(BootstrapDict p)
|
||||
{
|
||||
if (p.Id == "0")
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Dicts.InsertOne(p);
|
||||
|
|
|
@ -30,21 +30,21 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <returns></returns>
|
||||
public override bool Save(DataAccess.Group p)
|
||||
{
|
||||
if (p.Id == "0")
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Groups.InsertOne(new Group() {
|
||||
DbManager.Groups.InsertOne(new Group()
|
||||
{
|
||||
GroupName = p.GroupName,
|
||||
Description = p.Description,
|
||||
Roles = new List<string>()
|
||||
});
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DbManager.Groups.UpdateOne(md => md.Id == p.Id, Builders<Group>.Update.Set(md => md.GroupName, p.GroupName).Set(md => md.Description, p.Description));
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <returns></returns>
|
||||
public override bool Save(BootstrapMenu p)
|
||||
{
|
||||
if (p.Id == "0")
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Menus.InsertOne(p);
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Bootstrap.DataAccess.MongoDB
|
||||
{
|
||||
public class RejectUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获得/设置 操作日志主键ID
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
public DateTime RegisterTime { get; set; }
|
||||
|
||||
public string RejectedBy { get; set; }
|
||||
|
||||
public DateTime RejectedTime { get; set; }
|
||||
|
||||
public string RejectedReason { get; set; }
|
||||
}
|
||||
}
|
|
@ -27,7 +27,11 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
public override void DeleteByUserName(string userName) => DbManager.ResetUsers.DeleteMany(User => User.UserName.ToLowerInvariant() == userName.ToLowerInvariant());
|
||||
/// <returns></returns>
|
||||
public override bool Save()
|
||||
{
|
||||
DbManager.ResetUsers.InsertOne(this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <returns></returns>
|
||||
public override bool Save(DataAccess.Role p)
|
||||
{
|
||||
if (p.Id == "0")
|
||||
if (string.IsNullOrEmpty(p.Id))
|
||||
{
|
||||
p.Id = null;
|
||||
DbManager.Roles.InsertOne(new Role()
|
||||
|
@ -82,7 +82,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
var user = UserHelper.Retrieves().Cast<User>().FirstOrDefault(u => u.UserName.ToLowerInvariant() == userName.ToLowerInvariant());
|
||||
var role = RoleHelper.Retrieves();
|
||||
|
||||
roles.AddRange(user.Roles.Select(r => role.FirstOrDefault(rl => rl.Id == r).RoleName));
|
||||
roles.AddRange(role.Where(r => user.Roles.Any(rl => rl == r.Id)).Select(r => r.RoleName));
|
||||
if (roles.Count == 0) roles.Add("Default");
|
||||
return roles;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override IEnumerable<DataAccess.User> RetrieveNewUsers() => DbManager.Users.Find(user => user.ApprovedTime == DateTime.MinValue).SortByDescending(user => user.RegisterTime).ToList();
|
||||
public override IEnumerable<DataAccess.User> RetrieveNewUsers() => DbManager.Users.Find(user => !user.ApprovedTime.HasValue).SortByDescending(user => user.RegisterTime).ToList();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -107,11 +107,11 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
PassSalt = LgbCryptography.GenerateSalt(),
|
||||
Password = LgbCryptography.ComputeHash(user.Password, user.PassSalt),
|
||||
RegisterTime = DateTime.Now,
|
||||
ApprovedTime = DateTime.Now,
|
||||
ApprovedTime = user.ApprovedTime,
|
||||
ApprovedBy = user.ApprovedBy,
|
||||
Roles = new List<string>(),
|
||||
Groups = new List<string>(),
|
||||
Icon = "default.jpg",
|
||||
Icon = user.Icon,
|
||||
Description = user.Description,
|
||||
IsReset = 0
|
||||
});
|
||||
|
@ -150,6 +150,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
var newPassword = LgbCryptography.ComputeHash(password, passSalt);
|
||||
var update = Builders<User>.Update.Set(u => u.Password, newPassword).Set(u => u.PassSalt, passSalt);
|
||||
DbManager.Users.FindOneAndUpdate(u => u.UserName == UserName, update);
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -283,5 +284,75 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
DbManager.ResetUsers.DeleteMany(user => user.UserName.ToLowerInvariant() == userName.ToLowerInvariant());
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="approvedBy"></param>
|
||||
/// <returns></returns>
|
||||
public override bool Approve(string id, string approvedBy)
|
||||
{
|
||||
DbManager.Users.UpdateOne(User => User.Id == id, Builders<User>.Update.Set(md => md.ApprovedTime, DateTime.Now).Set(md => md.ApprovedBy, approvedBy));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="displayName"></param>
|
||||
/// <returns></returns>
|
||||
public override bool SaveDisplayName(string userName, string displayName)
|
||||
{
|
||||
DbManager.Users.UpdateOne(User => User.UserName == userName, Builders<User>.Update.Set(md => md.DisplayName, displayName));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="cssName"></param>
|
||||
/// <returns></returns>
|
||||
public override bool SaveUserCssByName(string userName, string cssName)
|
||||
{
|
||||
DbManager.Users.UpdateOne(User => User.UserName == userName, Builders<User>.Update.Set(md => md.Css, cssName));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="iconName"></param>
|
||||
/// <returns></returns>
|
||||
public override bool SaveUserIconByName(string userName, string iconName)
|
||||
{
|
||||
DbManager.Users.UpdateOne(User => User.UserName == userName, Builders<User>.Update.Set(md => md.Icon, iconName));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="rejectBy"></param>
|
||||
/// <returns></returns>
|
||||
public override bool Reject(string id, string rejectBy)
|
||||
{
|
||||
var user = UserHelper.RetrieveNewUsers().FirstOrDefault(u => u.Id == id);
|
||||
DbManager.RejectUsers.InsertOne(new RejectUser()
|
||||
{
|
||||
DisplayName = user.DisplayName,
|
||||
RegisterTime = user.RegisterTime,
|
||||
RejectedBy = rejectBy,
|
||||
RejectedReason = "",
|
||||
RejectedTime = DateTime.Now,
|
||||
UserName = user.UserName
|
||||
});
|
||||
DbManager.Users.DeleteOne(User => User.Id == id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,13 +53,6 @@ namespace Bootstrap.DataAccess
|
|||
/// <returns></returns>
|
||||
public virtual ResetUser RetrieveUserByUserName(string userName) => DbManager.Create().FirstOrDefault<ResetUser>("where UserName = @0 order by ResetTime desc", userName);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public virtual void DeleteByUserName(string userName) => DbManager.Create().Delete<ResetUser>("where UserName = @0", userName);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
@ -40,11 +40,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess.MongoD
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MongoDB", "MongoDB", "{A06A0AD8-A246-4329-B024-7174AE4A3EDE}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
DatabaseScripts\MongoDB\BootstrapAdmin.Dicts.json = DatabaseScripts\MongoDB\BootstrapAdmin.Dicts.json
|
||||
DatabaseScripts\MongoDB\BootstrapAdmin.Groups.json = DatabaseScripts\MongoDB\BootstrapAdmin.Groups.json
|
||||
DatabaseScripts\MongoDB\BootstrapAdmin.Navigations.json = DatabaseScripts\MongoDB\BootstrapAdmin.Navigations.json
|
||||
DatabaseScripts\MongoDB\BootstrapAdmin.Roles.json = DatabaseScripts\MongoDB\BootstrapAdmin.Roles.json
|
||||
DatabaseScripts\MongoDB\BootstrapAdmin.Users.json = DatabaseScripts\MongoDB\BootstrapAdmin.Users.json
|
||||
DatabaseScripts\MongoDB\Dicts.js = DatabaseScripts\MongoDB\Dicts.js
|
||||
DatabaseScripts\MongoDB\Groups.js = DatabaseScripts\MongoDB\Groups.js
|
||||
DatabaseScripts\MongoDB\init.js = DatabaseScripts\MongoDB\init.js
|
||||
DatabaseScripts\MongoDB\Navigations.js = DatabaseScripts\MongoDB\Navigations.js
|
||||
DatabaseScripts\MongoDB\Roles.js = DatabaseScripts\MongoDB\Roles.js
|
||||
DatabaseScripts\MongoDB\Users.js = DatabaseScripts\MongoDB\Users.js
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MySQL", "MySQL", "{084E2E94-6B7D-4D3E-9BF1-6972427FBF80}"
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
[
|
||||
{
|
||||
"_id": ObjectId("5bd7cb835fa31256f77e4eae"),
|
||||
"GroupName": "Admin",
|
||||
"Description": "系统默认组",
|
||||
"Roles": [
|
||||
"5bd7cc105fa31256f77e4eb7"
|
||||
]
|
||||
}
|
||||
]
|
|
@ -1,734 +0,0 @@
|
|||
[
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b90"),
|
||||
"ParentId": "0",
|
||||
"Name": "后台管理",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-gear",
|
||||
"Url": "~/Admin/Index",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b91"),
|
||||
"ParentId": "0",
|
||||
"Name": "个人中心",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-suitcase",
|
||||
"Url": "~/Admin/Profiles",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a01"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存显示名称",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveDisplayName",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a02"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存密码",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "savePassword",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a03"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存应用",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveApp",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a04"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存样式",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveTheme",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a05"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存头像",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveIcon",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b92"),
|
||||
"ParentId": "0",
|
||||
"Name": "返回前台",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-hand-o-left",
|
||||
"Url": "~/Home/Index",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b93"),
|
||||
"ParentId": "0",
|
||||
"Name": "网站设置",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Admin/Settings",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b01"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "保存系统名称",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveTitle",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b02"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "保存页脚设置",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveFooter",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b03"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "保存样式",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveTheme",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b04"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "清理缓存",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "clearCache",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b05"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "清理全部缓存",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "clearAllCache",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b94"),
|
||||
"ParentId": "0",
|
||||
"Name": "菜单管理",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-dashboard",
|
||||
"Url": "~/Admin/Menus",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b10"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b11"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b12"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b13"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "分配角色",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignRole",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b14"),
|
||||
"ParentId": "0",
|
||||
"Name": "图标页面",
|
||||
"Order": NumberInt(55),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Admin/IconView",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(1),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b95"),
|
||||
"ParentId": "0",
|
||||
"Name": "用户管理",
|
||||
"Order": NumberInt(60),
|
||||
"Icon": "fa fa-user",
|
||||
"Url": "~/Admin/Users",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b20"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b21"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b22"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b23"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "分配部门",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignGroup",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b24"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "分配角色",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignRole",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b96"),
|
||||
"ParentId": "0",
|
||||
"Name": "角色管理",
|
||||
"Order": NumberInt(70),
|
||||
"Icon": "fa fa-sitemap",
|
||||
"Url": "~/Admin/Roles",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b30"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b31"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b32"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b33"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配用户",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignUser",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b34"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配部门",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignGroup",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b35"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配菜单",
|
||||
"Order": NumberInt(60),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignMenu",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b36"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配应用",
|
||||
"Order": NumberInt(70),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignApp",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b97"),
|
||||
"ParentId": "0",
|
||||
"Name": "部门管理",
|
||||
"Order": NumberInt(80),
|
||||
"Icon": "fa fa-bank",
|
||||
"Url": "~/Admin/Groups",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b40"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b41"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b42"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b43"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "分配用户",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignUser",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b44"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "分配角色",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignRole",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b98"),
|
||||
"ParentId": "0",
|
||||
"Name": "字典表维护",
|
||||
"Order": NumberInt(90),
|
||||
"Icon": "fa fa-book",
|
||||
"Url": "~/Admin/Dicts",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b50"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b98",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b51"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b98",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b52"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b98",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b99"),
|
||||
"ParentId": "0",
|
||||
"Name": "站内消息",
|
||||
"Order": NumberInt(100),
|
||||
"Icon": "fa fa-envelope",
|
||||
"Url": "~/Admin/Messages",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9a"),
|
||||
"ParentId": "0",
|
||||
"Name": "任务管理",
|
||||
"Order": NumberInt(110),
|
||||
"Icon": "fa fa fa-tasks",
|
||||
"Url": "~/Admin/Tasks",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9b"),
|
||||
"ParentId": "0",
|
||||
"Name": "通知管理",
|
||||
"Order": NumberInt(120),
|
||||
"Icon": "fa fa-bell",
|
||||
"Url": "~/Admin/Notifications",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9c"),
|
||||
"ParentId": "0",
|
||||
"Name": "日志管理",
|
||||
"Order": NumberInt(130),
|
||||
"Icon": "fa fa-gears",
|
||||
"Url": "#",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f57"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9c",
|
||||
"Name": "操作日志",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-edit",
|
||||
"Url": "~/Admin/Logs",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f58"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9c",
|
||||
"Name": "登录日志",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-user-circle-o",
|
||||
"Url": "~/Admin/Logins",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f59"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9c",
|
||||
"Name": "访问日志",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-bars",
|
||||
"Url": "~/Admin/Traces",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b89"),
|
||||
"ParentId": "0",
|
||||
"Name": "在线用户",
|
||||
"Order": NumberInt(140),
|
||||
"Icon": "fa fa-users",
|
||||
"Url": "~/Admin/Online",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9d"),
|
||||
"ParentId": "0",
|
||||
"Name": "程序异常",
|
||||
"Order": NumberInt(150),
|
||||
"Icon": "fa fa-cubes",
|
||||
"Url": "~/Admin/Exceptions",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b60"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9d",
|
||||
"Name": "服务器日志",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "log",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9e"),
|
||||
"ParentId": "0",
|
||||
"Name": "工具集合",
|
||||
"Order": NumberInt(160),
|
||||
"Icon": "fa fa-gavel",
|
||||
"Url": "#",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9f"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9e",
|
||||
"Name": "客户端测试",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-wrench",
|
||||
"Url": "~/Admin/Mobile",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba0"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9e",
|
||||
"Name": "API文档",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-wrench",
|
||||
"Url": "~/swagger",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba1"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9e",
|
||||
"Name": "图标集",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-dashboard",
|
||||
"Url": "~/Admin/FAIcon",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba2"),
|
||||
"ParentId": "0",
|
||||
"Name": "首页",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Home/Index",
|
||||
"Category": "1",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "2"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba4"),
|
||||
"ParentId": "5bd9b3d868aa001661776f56",
|
||||
"Name": "关于",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Home/About",
|
||||
"Category": "1",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "2"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f56"),
|
||||
"ParentId": "0",
|
||||
"Name": "帮助",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "#",
|
||||
"Category": "1",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "2"
|
||||
}
|
||||
]
|
|
@ -1,16 +0,0 @@
|
|||
[
|
||||
{
|
||||
"_id": ObjectId("5bd7cc105fa31256f77e4eb7"),
|
||||
"RoleName": "Administrators",
|
||||
"Description": "系统管理员",
|
||||
"Menus": [],
|
||||
"Apps": []
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7cc105fa31256f77e4eb8"),
|
||||
"RoleName": "Default",
|
||||
"Description": "默认用户,可访问前台页面",
|
||||
"Menus": [],
|
||||
"Apps": []
|
||||
}
|
||||
]
|
|
@ -1,44 +0,0 @@
|
|||
[
|
||||
{
|
||||
"_id": ObjectId("5bd714195fa31256f77e4b64"),
|
||||
"UserName": "Admin",
|
||||
"Password": "yvWGJ6JqABFIxCZJy1czv5xR9CPI3KWMmevWn3CfGcc=",
|
||||
"PassSalt": "Zs6VGITmaveCFGBPKmNH+YM8DTyMi6D8cGKaNEyfDuaaMvTe",
|
||||
"DisplayName": "Administrator",
|
||||
"RegisterTime": ISODate("2018-09-09T06:06:20.130+0000"),
|
||||
"ApprovedTime": ISODate("2018-09-09T06:06:20.130+0000"),
|
||||
"ApprovedBy": "system",
|
||||
"Description": "系统默认创建",
|
||||
"Icon": "default.jpg",
|
||||
"Css": null,
|
||||
"App": null,
|
||||
"IsReset": 0,
|
||||
"Roles": [
|
||||
"5bd7cc105fa31256f77e4eb7"
|
||||
],
|
||||
"Groups": [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd714195fa31256f77e4b67"),
|
||||
"UserName": "user",
|
||||
"Password": "2v9os69yRQ2j3y3/J+CCd4bG3mlu/fn+wGpZBzFlhOg=",
|
||||
"PassSalt": "djT5LiGxwS1l8aDGP0f92v06fbA5BhOcwRGkv5ENIHFtzc1b",
|
||||
"DisplayName": "测试用户",
|
||||
"RegisterTime": ISODate("2018-09-13T13:27:12.957+0000"),
|
||||
"ApprovedTime": ISODate("2018-09-13T13:27:12.957+0000"),
|
||||
"ApprovedBy": "Admin",
|
||||
"Description": "管理员Admin创建用户",
|
||||
"Icon": "default.jpg",
|
||||
"Css": null,
|
||||
"App": null,
|
||||
"IsReset": 0,
|
||||
"Groups": [
|
||||
|
||||
],
|
||||
"Roles": [
|
||||
"5bd7cc105fa31256f77e4eb8"
|
||||
]
|
||||
}
|
||||
]
|
|
@ -1,359 +1,309 @@
|
|||
[
|
||||
Dicts = [
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a13"),
|
||||
"Category": "菜单",
|
||||
"Name": "系统菜单",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a14"),
|
||||
"Category": "菜单",
|
||||
"Name": "外部菜单",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a15"),
|
||||
"Category": "应用程序",
|
||||
"Name": "未设置",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a16"),
|
||||
"Category": "网站设置",
|
||||
"Name": "网站标题",
|
||||
"Code": "后台管理系统",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a17"),
|
||||
"Category": "网站设置",
|
||||
"Name": "网站页脚",
|
||||
"Code": "2016 © 通用后台管理系统",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a18"),
|
||||
"Category": "系统通知",
|
||||
"Name": "用户注册",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a19"),
|
||||
"Category": "系统通知",
|
||||
"Name": "程序异常",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a1a"),
|
||||
"Category": "系统通知",
|
||||
"Name": "数据库连接",
|
||||
"Code": "2",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a1b"),
|
||||
"Category": "通知状态",
|
||||
"Name": "未处理",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a1c"),
|
||||
"Category": "通知状态",
|
||||
"Name": "已处理",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a1d"),
|
||||
"Category": "处理结果",
|
||||
"Name": "同意",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a1e"),
|
||||
"Category": "处理结果",
|
||||
"Name": "拒绝",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a1f"),
|
||||
"Category": "消息状态",
|
||||
"Name": "未读",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a20"),
|
||||
"Category": "消息状态",
|
||||
"Name": "已读",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a21"),
|
||||
"Category": "消息标签",
|
||||
"Name": "一般",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a22"),
|
||||
"Category": "消息标签",
|
||||
"Name": "紧要",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a23"),
|
||||
"Category": "头像地址",
|
||||
"Name": "头像路径",
|
||||
"Code": "~/images/uploader/",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("4bd6c73d5fa31256f77e4a23"),
|
||||
"Category": "头像地址",
|
||||
"Name": "头像文件",
|
||||
"Code": "default.jpg",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a24"),
|
||||
"Category": "当前样式",
|
||||
"Name": "使用样式",
|
||||
"Code": "blue.css",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a25"),
|
||||
"Category": "网站设置",
|
||||
"Name": "前台首页",
|
||||
"Code": "~/Home/Index",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a26"),
|
||||
"Category": "应用程序",
|
||||
"Name": "组垛平台",
|
||||
"Code": "4",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a27"),
|
||||
"Category": "组垛平台",
|
||||
"Name": "网站标题",
|
||||
"Code": "托盘组垛程序",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a28"),
|
||||
"Category": "组垛平台",
|
||||
"Name": "网站页脚",
|
||||
"Code": "版权所有:中烟信息",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a29"),
|
||||
"Category": "组垛平台",
|
||||
"Name": "个人中心地址",
|
||||
"Code": "http://localhost:50852/Admin/Profiles",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a2a"),
|
||||
"Category": "组垛平台",
|
||||
"Name": "系统设置地址",
|
||||
"Code": "http://localhost:50852/Admin/Index",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a2b"),
|
||||
"Category": "设备厂商",
|
||||
"Name": "远望谷",
|
||||
"Code": "Invengo",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a2c"),
|
||||
"Category": "设备厂商",
|
||||
"Name": "测试",
|
||||
"Code": "Test",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a2d"),
|
||||
"Category": "远程数据库",
|
||||
"Name": "组垛数据库",
|
||||
"Code": "Corp_Scan",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a2e"),
|
||||
"Category": "网站样式",
|
||||
"Name": "黑色样式",
|
||||
"Code": "black.css",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a2f"),
|
||||
"Category": "网站样式",
|
||||
"Name": "蓝色样式",
|
||||
"Code": "blue.css",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a30"),
|
||||
"Category": "设备天线",
|
||||
"Name": "天线1",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a31"),
|
||||
"Category": "设备天线",
|
||||
"Name": "天线2",
|
||||
"Code": "2",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a32"),
|
||||
"Category": "应用程序",
|
||||
"Name": "测试平台",
|
||||
"Code": "2",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a33"),
|
||||
"Category": "测试平台",
|
||||
"Name": "网站标题",
|
||||
"Code": "托盘组垛程序",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a34"),
|
||||
"Category": "测试平台",
|
||||
"Name": "网站页脚",
|
||||
"Code": "通用后台管理测试平台",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a35"),
|
||||
"Category": "测试平台",
|
||||
"Name": "个人中心地址",
|
||||
"Code": "http://localhost:50852/Admin/Profiles",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a36"),
|
||||
"Category": "测试平台",
|
||||
"Name": "系统设置地址",
|
||||
"Code": "http://localhost:50852/Admin/Index",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a12"),
|
||||
"Category": "测试平台",
|
||||
"Name": "系统通知地址",
|
||||
"Code": "http://localhost:50852/Admin/Notifications",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a37"),
|
||||
"Category": "设备驱动",
|
||||
"Name": "Invengo",
|
||||
"Code": "Longbow.Invengo.Device, Longbow.Invengo",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a38"),
|
||||
"Category": "设备驱动",
|
||||
"Name": "Test",
|
||||
"Code": "Pallet.DeviceInterface.Device, Pallet.DeviceHub",
|
||||
"Define": NumberInt(1)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a39"),
|
||||
"Category": "应用首页",
|
||||
"Name": "2",
|
||||
"Code": "http://localhost:49185/",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a40"),
|
||||
"Category": "系统设置",
|
||||
"Name": "程序异常保留时长",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a41"),
|
||||
|
||||
"Category": "系统设置",
|
||||
"Name": "操作日志保留时长",
|
||||
"Code": "12",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a42"),
|
||||
"Category": "系统设置",
|
||||
"Name": "登录日志保留时长",
|
||||
"Code": "12",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a43"),
|
||||
"Category": "系统设置",
|
||||
"Name": "Cookie保留时长",
|
||||
"Code": "7",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a44"),
|
||||
"Category": "系统设置",
|
||||
"Name": "IP地理位置接口",
|
||||
"Code": "None",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a45"),
|
||||
"Category": "系统设置",
|
||||
"Name": "BaiDuIPSvr",
|
||||
"Code": "http://api.map.baidu.com/location/ip?ak=6lvVPMDlm2gjLpU0aiqPsHXi2OiwGQRj&ip=",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a46"),
|
||||
"Category": "系统设置",
|
||||
"Name": "JuheIPSvr",
|
||||
"Code": "http://apis.juhe.cn/ip/ipNew?key=f57102d1b9fadd3f4a1c29072d0c0206&ip=",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a47"),
|
||||
"Category": "系统设置",
|
||||
"Name": "访问日志保留时长",
|
||||
"Code": "1",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a48"),
|
||||
"Category": "系统设置",
|
||||
"Name": "演示系统",
|
||||
"Code": "0",
|
||||
"Define": NumberInt(0)
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd6c73d5fa31256f77e4a49"),
|
||||
"Category": "系统设置",
|
||||
"Name": "验证码图床",
|
||||
"Code": "http://images.sdgxgz.com/",
|
||||
"Define": NumberInt(0)
|
||||
}
|
||||
]
|
||||
];
|
|
@ -0,0 +1,7 @@
|
|||
Groups = [
|
||||
{
|
||||
"GroupName": "Admin",
|
||||
"Description": "系统默认组",
|
||||
"Roles": []
|
||||
}
|
||||
];
|
|
@ -0,0 +1,734 @@
|
|||
var Navigations = [
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b90"),
|
||||
"ParentId": "0",
|
||||
"Name": "后台管理",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-gear",
|
||||
"Url": "~/Admin/Index",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b91"),
|
||||
"ParentId": "0",
|
||||
"Name": "个人中心",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-suitcase",
|
||||
"Url": "~/Admin/Profiles",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a01"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存显示名称",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveDisplayName",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a02"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存密码",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "savePassword",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a03"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存应用",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveApp",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a04"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存样式",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveTheme",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4a05"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b91",
|
||||
"Name": "保存头像",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveIcon",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b92"),
|
||||
"ParentId": "0",
|
||||
"Name": "返回前台",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-hand-o-left",
|
||||
"Url": "~/Home/Index",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b93"),
|
||||
"ParentId": "0",
|
||||
"Name": "网站设置",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Admin/Settings",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b01"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "保存系统名称",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveTitle",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b02"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "保存页脚设置",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveFooter",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b03"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "保存样式",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "saveTheme",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b04"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "清理缓存",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "clearCache",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b05"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b93",
|
||||
"Name": "清理全部缓存",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "clearAllCache",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b94"),
|
||||
"ParentId": "0",
|
||||
"Name": "菜单管理",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-dashboard",
|
||||
"Url": "~/Admin/Menus",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b10"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b11"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b12"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b13"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b94",
|
||||
"Name": "分配角色",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignRole",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b14"),
|
||||
"ParentId": "0",
|
||||
"Name": "图标页面",
|
||||
"Order": NumberInt(55),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Admin/IconView",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(1),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b95"),
|
||||
"ParentId": "0",
|
||||
"Name": "用户管理",
|
||||
"Order": NumberInt(60),
|
||||
"Icon": "fa fa-user",
|
||||
"Url": "~/Admin/Users",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b20"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b21"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b22"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b23"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "分配部门",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignGroup",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b24"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b95",
|
||||
"Name": "分配角色",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignRole",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b96"),
|
||||
"ParentId": "0",
|
||||
"Name": "角色管理",
|
||||
"Order": NumberInt(70),
|
||||
"Icon": "fa fa-sitemap",
|
||||
"Url": "~/Admin/Roles",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b30"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b31"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b32"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b33"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配用户",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignUser",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b34"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配部门",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignGroup",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b35"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配菜单",
|
||||
"Order": NumberInt(60),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignMenu",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b36"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b96",
|
||||
"Name": "分配应用",
|
||||
"Order": NumberInt(70),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignApp",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b97"),
|
||||
"ParentId": "0",
|
||||
"Name": "部门管理",
|
||||
"Order": NumberInt(80),
|
||||
"Icon": "fa fa-bank",
|
||||
"Url": "~/Admin/Groups",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b40"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b41"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b42"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b43"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "分配用户",
|
||||
"Order": NumberInt(40),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignUser",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b44"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b97",
|
||||
"Name": "分配角色",
|
||||
"Order": NumberInt(50),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "assignRole",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b98"),
|
||||
"ParentId": "0",
|
||||
"Name": "字典表维护",
|
||||
"Order": NumberInt(90),
|
||||
"Icon": "fa fa-book",
|
||||
"Url": "~/Admin/Dicts",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b50"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b98",
|
||||
"Name": "新增",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "add",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b51"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b98",
|
||||
"Name": "编辑",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "edit",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b52"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b98",
|
||||
"Name": "删除",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "del",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b99"),
|
||||
"ParentId": "0",
|
||||
"Name": "站内消息",
|
||||
"Order": NumberInt(100),
|
||||
"Icon": "fa fa-envelope",
|
||||
"Url": "~/Admin/Messages",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9a"),
|
||||
"ParentId": "0",
|
||||
"Name": "任务管理",
|
||||
"Order": NumberInt(110),
|
||||
"Icon": "fa fa fa-tasks",
|
||||
"Url": "~/Admin/Tasks",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9b"),
|
||||
"ParentId": "0",
|
||||
"Name": "通知管理",
|
||||
"Order": NumberInt(120),
|
||||
"Icon": "fa fa-bell",
|
||||
"Url": "~/Admin/Notifications",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9c"),
|
||||
"ParentId": "0",
|
||||
"Name": "日志管理",
|
||||
"Order": NumberInt(130),
|
||||
"Icon": "fa fa-gears",
|
||||
"Url": "#",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f57"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9c",
|
||||
"Name": "操作日志",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-edit",
|
||||
"Url": "~/Admin/Logs",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f58"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9c",
|
||||
"Name": "登录日志",
|
||||
"Order": NumberInt(20),
|
||||
"Icon": "fa fa-user-circle-o",
|
||||
"Url": "~/Admin/Logins",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f59"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9c",
|
||||
"Name": "访问日志",
|
||||
"Order": NumberInt(30),
|
||||
"Icon": "fa fa-bars",
|
||||
"Url": "~/Admin/Traces",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b89"),
|
||||
"ParentId": "0",
|
||||
"Name": "在线用户",
|
||||
"Order": NumberInt(140),
|
||||
"Icon": "fa fa-users",
|
||||
"Url": "~/Admin/Online",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9d"),
|
||||
"ParentId": "0",
|
||||
"Name": "程序异常",
|
||||
"Order": NumberInt(150),
|
||||
"Icon": "fa fa-cubes",
|
||||
"Url": "~/Admin/Exceptions",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b60"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9d",
|
||||
"Name": "服务器日志",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "log",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(2),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9e"),
|
||||
"ParentId": "0",
|
||||
"Name": "工具集合",
|
||||
"Order": NumberInt(160),
|
||||
"Icon": "fa fa-gavel",
|
||||
"Url": "#",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4b9f"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9e",
|
||||
"Name": "客户端测试",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-wrench",
|
||||
"Url": "~/Admin/Mobile",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba0"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9e",
|
||||
"Name": "API文档",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-wrench",
|
||||
"Url": "~/swagger",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba1"),
|
||||
"ParentId": "5bd7b8445fa31256f77e4b9e",
|
||||
"Name": "图标集",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-dashboard",
|
||||
"Url": "~/Admin/FAIcon",
|
||||
"Category": "0",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "0"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba2"),
|
||||
"ParentId": "0",
|
||||
"Name": "首页",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Home/Index",
|
||||
"Category": "1",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "2"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd7b8445fa31256f77e4ba4"),
|
||||
"ParentId": "5bd9b3d868aa001661776f56",
|
||||
"Name": "关于",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "~/Home/About",
|
||||
"Category": "1",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "2"
|
||||
},
|
||||
{
|
||||
"_id": ObjectId("5bd9b3d868aa001661776f56"),
|
||||
"ParentId": "0",
|
||||
"Name": "帮助",
|
||||
"Order": NumberInt(10),
|
||||
"Icon": "fa fa-fa",
|
||||
"Url": "#",
|
||||
"Category": "1",
|
||||
"Target": "_self",
|
||||
"IsResource": NumberInt(0),
|
||||
"Application": "2"
|
||||
}
|
||||
];
|
|
@ -0,0 +1,14 @@
|
|||
Roles = [
|
||||
{
|
||||
"RoleName": "Administrators",
|
||||
"Description": "系统管理员",
|
||||
"Menus": [],
|
||||
"Apps": []
|
||||
},
|
||||
{
|
||||
"RoleName": "Default",
|
||||
"Description": "默认用户,可访问前台页面",
|
||||
"Menus": [],
|
||||
"Apps": []
|
||||
}
|
||||
];
|
|
@ -0,0 +1,34 @@
|
|||
Users = [
|
||||
{
|
||||
"UserName": "Admin",
|
||||
"Password": "yvWGJ6JqABFIxCZJy1czv5xR9CPI3KWMmevWn3CfGcc=",
|
||||
"PassSalt": "Zs6VGITmaveCFGBPKmNH+YM8DTyMi6D8cGKaNEyfDuaaMvTe",
|
||||
"DisplayName": "Administrator",
|
||||
"RegisterTime": ISODate("2018-09-09T06:06:20.130+0000"),
|
||||
"ApprovedTime": ISODate("2018-09-09T06:06:20.130+0000"),
|
||||
"ApprovedBy": "system",
|
||||
"Description": "系统默认创建",
|
||||
"Icon": "default.jpg",
|
||||
"Css": null,
|
||||
"App": null,
|
||||
"IsReset": 0,
|
||||
"Roles": [],
|
||||
"Groups": []
|
||||
},
|
||||
{
|
||||
"UserName": "user",
|
||||
"Password": "2v9os69yRQ2j3y3/J+CCd4bG3mlu/fn+wGpZBzFlhOg=",
|
||||
"PassSalt": "djT5LiGxwS1l8aDGP0f92v06fbA5BhOcwRGkv5ENIHFtzc1b",
|
||||
"DisplayName": "测试用户",
|
||||
"RegisterTime": ISODate("2018-09-13T13:27:12.957+0000"),
|
||||
"ApprovedTime": ISODate("2018-09-13T13:27:12.957+0000"),
|
||||
"ApprovedBy": "Admin",
|
||||
"Description": "管理员Admin创建用户",
|
||||
"Icon": "default.jpg",
|
||||
"Css": null,
|
||||
"App": null,
|
||||
"IsReset": 0,
|
||||
"Groups": [],
|
||||
"Roles": []
|
||||
}
|
||||
];
|
|
@ -0,0 +1,33 @@
|
|||
load("Dicts.js");
|
||||
load("Navigations.js");
|
||||
load("Groups.js");
|
||||
load("Roles.js");
|
||||
load("Users.js");
|
||||
|
||||
conn = new Mongo("localhost:27017");
|
||||
db = conn.getDB("BootstrapAdmin");
|
||||
|
||||
// Dicts
|
||||
db.Dicts.drop();
|
||||
db.createCollection('Dicts');
|
||||
db.getCollection("Dicts").insert(Dicts);
|
||||
|
||||
// Navigations
|
||||
db.Navigations.drop();
|
||||
db.createCollection('Navigations');
|
||||
db.getCollection("Navigations").insert(Navigations);
|
||||
|
||||
// Groups
|
||||
db.Groups.drop();
|
||||
db.createCollection('Groups');
|
||||
db.getCollection("Groups").insert(Groups);
|
||||
|
||||
// Roles
|
||||
db.Roles.drop();
|
||||
db.createCollection('Roles');
|
||||
db.getCollection("Roles").insert(Roles);
|
||||
|
||||
// Users
|
||||
db.Users.drop();
|
||||
db.createCollection('Users');
|
||||
db.getCollection("Users").insert(Users);
|
|
@ -68,6 +68,9 @@ namespace Bootstrap.Admin
|
|||
new KeyValuePair<string, string>("DB:2:Enabled", "false"),
|
||||
new KeyValuePair<string, string>("DB:3:Enabled", "false")
|
||||
}));
|
||||
if (!string.IsNullOrEmpty(TestHelper.MongoDBName)) builder.ConfigureAppConfiguration(app => app.AddInMemoryCollection(new KeyValuePair<string, string>[] {
|
||||
new KeyValuePair<string, string>("MongoDB", TestHelper.MongoDBName)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,6 +134,7 @@ namespace Bootstrap.Admin
|
|||
TestHelper.SQLServerConnectionString = con.GetConnectionString("sqlserver");
|
||||
TestHelper.MySqlConnectionString = con.GetConnectionString("mysql");
|
||||
TestHelper.NpgSqlConnectionString = con.GetConnectionString("npgsql");
|
||||
TestHelper.MongoDBName = con.GetValue("MongoDB", "UnitTest");
|
||||
}
|
||||
TestHelper.SQLiteConnectionString = con.GetConnectionString("sqlite");
|
||||
TestHelper.ConfigureWebHost(builder);
|
||||
|
|
|
@ -9,32 +9,26 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void RetrievesByRoleId_Ok()
|
||||
{
|
||||
var db = DbManager.Create();
|
||||
db.Execute("delete from RoleApp");
|
||||
var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id;
|
||||
var app = new App();
|
||||
Assert.NotEmpty(app.RetrievesByRoleId(rid));
|
||||
var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id;
|
||||
AppHelper.SaveByRoleId(rid, new string[0]);
|
||||
Assert.NotEmpty(AppHelper.RetrievesByRoleId(rid));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrievesByUserName_Ok()
|
||||
{
|
||||
var app = new App();
|
||||
Assert.NotEmpty(app.RetrievesByUserName("Admin"));
|
||||
var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
var userId = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == "Admin").Id;
|
||||
UserHelper.SaveByRoleId(roleId, new string[] { userId });
|
||||
Assert.NotEmpty(AppHelper.RetrievesByUserName("Admin"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveByRoleId_Ok()
|
||||
{
|
||||
var db = DbManager.Create();
|
||||
db.Execute("delete from RoleApp");
|
||||
|
||||
var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id;
|
||||
var app = new App();
|
||||
Assert.True(app.SaveByRoleId(rid, new string[] { "1", "2" }));
|
||||
|
||||
var count = db.ExecuteScalar<int>("select count(Id) from RoleApp where RoleID = @0", rid);
|
||||
Assert.Equal(2, count);
|
||||
var rid = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
Assert.True(AppHelper.SaveByRoleId(rid, new string[] { "2" }));
|
||||
Assert.NotEmpty(AppHelper.RetrievesByRoleId(rid).Where(r => r.Checked == "checked"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Bootstrap.Security;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
|
@ -11,15 +12,15 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void SaveAndDelete_Ok()
|
||||
{
|
||||
var dict = new Dict()
|
||||
var dict = new BootstrapDict()
|
||||
{
|
||||
Category = "UnitTest",
|
||||
Name = "Test1",
|
||||
Code = "1",
|
||||
Define = 1
|
||||
};
|
||||
Assert.True(dict.Save(dict));
|
||||
Assert.True(dict.Delete(dict.RetrieveDicts().Where(d => d.Category == dict.Category).Select(d => d.Id)));
|
||||
Assert.True(DictHelper.Save(dict));
|
||||
Assert.True(DictHelper.Delete(DictHelper.RetrieveDicts().Where(d => d.Category == dict.Category).Select(d => d.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -32,117 +33,102 @@ namespace Bootstrap.DataAccess
|
|||
Code = "1",
|
||||
Define = 1
|
||||
};
|
||||
Assert.True(dict.SaveSettings(dict));
|
||||
dict.Delete(dict.RetrieveDicts().Where(d => d.Category == dict.Category).Select(d => d.Id));
|
||||
Assert.True(DictHelper.SaveSettings(dict));
|
||||
dict.Delete(DictHelper.RetrieveDicts().Where(d => d.Category == dict.Category).Select(d => d.Id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveCategories_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.NotEmpty(dict.RetrieveCategories());
|
||||
Assert.NotEmpty(DictHelper.RetrieveCategories());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveWebTitle_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal("后台管理系统", dict.RetrieveWebTitle());
|
||||
Assert.Equal("后台管理系统", DictHelper.RetrieveWebTitle());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveWebFooter_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal("2016 © 通用后台管理系统", dict.RetrieveWebFooter());
|
||||
Assert.Equal("2016 © 通用后台管理系统", DictHelper.RetrieveWebFooter());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveThemes_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.NotEmpty(dict.RetrieveThemes());
|
||||
Assert.NotEmpty(DictHelper.RetrieveThemes());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveActiveTheme_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal("blue.css", dict.RetrieveActiveTheme());
|
||||
Assert.Equal("blue.css", DictHelper.RetrieveActiveTheme());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveIconFolderPath_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal("~/images/uploader/", dict.RetrieveIconFolderPath());
|
||||
Assert.Equal("~/images/uploader/", DictHelper.RetrieveIconFolderPath());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveHomeUrl_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal("~/Home/Index", dict.RetrieveHomeUrl("0"));
|
||||
Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("0"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveApps_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.NotEmpty(dict.RetrieveApps());
|
||||
Assert.NotEmpty(DictHelper.RetrieveApps());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveDicts_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.NotEmpty(dict.RetrieveDicts());
|
||||
Assert.NotEmpty(DictHelper.RetrieveDicts());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveCookieExpiresPeriod_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal(7, dict.RetrieveCookieExpiresPeriod());
|
||||
Assert.Equal(7, DictHelper.RetrieveCookieExpiresPeriod());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveExceptionsLogPeriod_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal(1, dict.RetrieveExceptionsLogPeriod());
|
||||
Assert.Equal(1, DictHelper.RetrieveExceptionsLogPeriod());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveLoginLogsPeriod_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal(12, dict.RetrieveLoginLogsPeriod());
|
||||
Assert.Equal(12, DictHelper.RetrieveLoginLogsPeriod());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveLogsPeriod_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal(12, dict.RetrieveLogsPeriod());
|
||||
Assert.Equal(12, DictHelper.RetrieveLogsPeriod());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveLocaleIP_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
var ipSvr = dict.RetrieveLocaleIPSvr();
|
||||
var ipSvr = DictHelper.RetrieveLocaleIPSvr();
|
||||
Assert.Equal("None", ipSvr);
|
||||
|
||||
var ipUri = dict.RetrieveLocaleIPSvrUrl("JuheIPSvr");
|
||||
var ipUri = DictHelper.RetrieveLocaleIPSvrUrl("JuheIPSvr");
|
||||
Assert.NotNull(ipUri);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void BaiduIPSvr_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
var ipUri = dict.RetrieveLocaleIPSvrUrl("BaiDuIPSvr");
|
||||
var ipUri = DictHelper.RetrieveLocaleIPSvrUrl("BaiDuIPSvr");
|
||||
|
||||
var client = HttpClientFactory.Create();
|
||||
|
||||
|
@ -158,24 +144,22 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public async void JuheIPSvr_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
var ipUri = dict.RetrieveLocaleIPSvrUrl("JuheIPSvr");
|
||||
var ipUri = DictHelper.RetrieveLocaleIPSvrUrl("JuheIPSvr");
|
||||
|
||||
// 日本东京
|
||||
var client = HttpClientFactory.Create();
|
||||
var locator = await client.GetAsJsonAsync<JuheIPLocator>($"{ipUri}207.148.111.94");
|
||||
Assert.Equal(0, locator.Error_Code);
|
||||
Assert.Contains(new int[] { 0, 10012 }, c => c == locator.Error_Code);
|
||||
|
||||
// 四川成都
|
||||
locator = await client.GetAsJsonAsync<JuheIPLocator>($"{ipUri}182.148.123.196");
|
||||
Assert.Equal(0, locator.Error_Code);
|
||||
Assert.Contains(new int[] { 0, 10012 }, c => c == locator.Error_Code);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveAccessLogPeriod_Ok()
|
||||
{
|
||||
var dict = new Dict();
|
||||
Assert.Equal(1, dict.RetrieveAccessLogPeriod());
|
||||
Assert.Equal(1, DictHelper.RetrieveAccessLogPeriod());
|
||||
}
|
||||
|
||||
#region Private Class For Test
|
||||
|
|
|
@ -7,26 +7,17 @@ namespace Bootstrap.DataAccess
|
|||
[Collection("SQLServerContext")]
|
||||
public class ExceptionsTest
|
||||
{
|
||||
[Fact]
|
||||
public void Log_Ok()
|
||||
{
|
||||
Exceptions excep = new Exceptions();
|
||||
Assert.True(excep.Log(new Exception("UnitTest"), null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Retrieves_Ok()
|
||||
{
|
||||
Exceptions excep = new Exceptions();
|
||||
excep.Log(new Exception("UnitTest"), null);
|
||||
Assert.NotEmpty(excep.Retrieves());
|
||||
ExceptionsHelper.Log(new Exception("UnitTest"), null);
|
||||
Assert.NotEmpty(ExceptionsHelper.Retrieves());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrievePages_Ok()
|
||||
{
|
||||
var excep = new Exceptions();
|
||||
var op = excep.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "LogTime", Order = "desc" }, null, null);
|
||||
var op = ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "LogTime", Order = "desc" }, null, null);
|
||||
Assert.NotNull(op);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,54 +9,52 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void Retrieves_Ok()
|
||||
{
|
||||
Group g = new Group();
|
||||
Assert.NotEmpty(g.Retrieves());
|
||||
Assert.NotEmpty(GroupHelper.Retrieves());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveAndDelete_Ok()
|
||||
{
|
||||
Group g = new Group() { GroupName = "UnitTest", Description = "UnitTestSave" };
|
||||
Assert.True(g.Save(g));
|
||||
Assert.True(GroupHelper.Save(g));
|
||||
|
||||
var ids = g.Retrieves().Where(t => t.GroupName == "UnitTest").Select(t => t.Id);
|
||||
Assert.True(g.Delete(ids));
|
||||
var ids = GroupHelper.Retrieves().Where(t => t.GroupName == "UnitTest").Select(t => t.Id);
|
||||
Assert.True(GroupHelper.Delete(ids));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrievesByRoleId_Ok()
|
||||
{
|
||||
Group p = new Group();
|
||||
var groups = p.RetrievesByRoleId(new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id);
|
||||
var groups = GroupHelper.RetrievesByRoleId(RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id);
|
||||
Assert.NotEmpty(groups);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrievesByUserId_Ok()
|
||||
{
|
||||
Group p = new Group();
|
||||
var groups = p.RetrievesByUserId("1");
|
||||
var userId = UserHelper.Retrieves().FirstOrDefault(r => r.UserName == "Admin").Id;
|
||||
var groups = GroupHelper.RetrievesByUserId(userId);
|
||||
Assert.NotNull(groups);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveByUserId_Ok()
|
||||
{
|
||||
Group p = new Group();
|
||||
var groups = p.SaveByUserId("1", new string[] { "1", "2", "3" });
|
||||
var userId = UserHelper.Retrieves().FirstOrDefault(r => r.UserName == "Admin").Id;
|
||||
Assert.True(GroupHelper.SaveByUserId(userId, GroupHelper.Retrieves().Select(g => g.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveByRoleId_Ok()
|
||||
{
|
||||
Group p = new Group();
|
||||
var groups = p.SaveByRoleId("1", new string[] { "1", "2" });
|
||||
var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
Assert.True(GroupHelper.SaveByRoleId(roleId, GroupHelper.Retrieves().Select(g => g.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrievesByUserName_Ok()
|
||||
{
|
||||
Group p = new Group();
|
||||
Assert.NotNull(p.RetrievesByUserName("Admin"));
|
||||
Assert.NotNull(GroupHelper.RetrievesByUserName("Admin"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Bootstrap.DataAccess
|
|||
CRUD = "UnitTest",
|
||||
RequestUrl = "~/Home/Index"
|
||||
};
|
||||
Assert.True(log.Save(log));
|
||||
Assert.True(LogHelper.Save(log));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -35,8 +35,8 @@ namespace Bootstrap.DataAccess
|
|||
CRUD = "UnitTest",
|
||||
RequestUrl = "~/Home/Index"
|
||||
};
|
||||
log.Save(log);
|
||||
Assert.NotNull(log.Retrieves(new PaginationOption() { Limit = 20, Order = "LogTime" }, null, null, null));
|
||||
LogHelper.Save(log);
|
||||
Assert.NotNull(LogHelper.Retrieves(new PaginationOption() { Limit = 20, Order = "LogTime" }, null, null, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void Save_Ok()
|
||||
{
|
||||
var m = new Menu();
|
||||
var poco = new BootstrapMenu()
|
||||
{
|
||||
Name = "UnitTest",
|
||||
|
@ -23,22 +22,20 @@ namespace Bootstrap.DataAccess
|
|||
Url = "#",
|
||||
ParentId = "0"
|
||||
};
|
||||
m.Delete(m.RetrieveAllMenus("Admin").Where(n => n.Name == m.Name).Select(n => n.Id));
|
||||
Assert.True(m.Save(poco));
|
||||
m.Delete(new string[] { poco.Id });
|
||||
Assert.True(MenuHelper.Save(poco));
|
||||
MenuHelper.Delete(MenuHelper.RetrieveAllMenus("Admin").Where(n => n.Name == poco.Name).Select(n => n.Id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveMenusByRoleId_Ok()
|
||||
{
|
||||
var m = new Menu();
|
||||
Assert.NotEmpty(m.RetrieveMenusByRoleId("1"));
|
||||
var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
Assert.NotEmpty(MenuHelper.RetrieveMenusByRoleId(roleId));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Delete_Ok()
|
||||
{
|
||||
var m = new Menu();
|
||||
var poco = new BootstrapMenu()
|
||||
{
|
||||
Name = "UnitTest",
|
||||
|
@ -51,22 +48,21 @@ namespace Bootstrap.DataAccess
|
|||
Url = "#",
|
||||
ParentId = "0"
|
||||
};
|
||||
m.Save(poco);
|
||||
Assert.True(m.Delete(new string[] { poco.Id }));
|
||||
MenuHelper.Save(poco);
|
||||
MenuHelper.Delete(MenuHelper.RetrieveAllMenus("Admin").Where(n => n.Name == poco.Name).Select(n => n.Id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveAllMenus_Ok()
|
||||
{
|
||||
var m = new Menu();
|
||||
Assert.NotEmpty(m.RetrieveAllMenus("Admin"));
|
||||
Assert.NotEmpty(MenuHelper.RetrieveAllMenus("Admin"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveMenusByRoleId_Ok()
|
||||
{
|
||||
var m = new Menu();
|
||||
Assert.True(m.SaveMenusByRoleId("1", new string[] { "450", "451" }));
|
||||
var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
Assert.True(MenuHelper.SaveMenusByRoleId(roleId, MenuHelper.RetrieveAllMenus("Admin").Select(m => m.Id)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void RetrieveHeaders_Ok()
|
||||
{
|
||||
var m = new Message();
|
||||
m.RetrieveHeaders("Admin");
|
||||
Assert.NotNull(MessageHelper.Retrieves("Admin"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
using Xunit;
|
||||
|
||||
namespace Bootstrap.DataAccess.MongoDB
|
||||
{
|
||||
[Collection("MongoContext")]
|
||||
public class ResetUserTest : DataAccess.ResetUserTest
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
using Xunit;
|
||||
|
||||
namespace Bootstrap.DataAccess.MySql
|
||||
{
|
||||
[Collection("MySqlContext")]
|
||||
public class ResetUserTest : DataAccess.ResetUserTest
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
|
||||
namespace Bootstrap.DataAccess
|
||||
|
@ -7,71 +8,16 @@ namespace Bootstrap.DataAccess
|
|||
public class ResetUserTest
|
||||
{
|
||||
[Fact]
|
||||
public void Save_Ok()
|
||||
public void ResetReasonsByUserName_Ok()
|
||||
{
|
||||
var resetUser = new ResetUser()
|
||||
{
|
||||
UserName = "UnitTest",
|
||||
Reason = "UnitTest",
|
||||
DisplayName = "UnitTest",
|
||||
ResetTime = DateTime.Now
|
||||
};
|
||||
var db = DbManager.Create();
|
||||
db.Save(resetUser);
|
||||
var count = db.ExecuteScalar<int>("select count(Id) from ResetUsers");
|
||||
Assert.True(count > 0);
|
||||
}
|
||||
var user = new User { UserName = "UnitTestReset", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" };
|
||||
UserHelper.Delete(UserHelper.Retrieves().Union(UserHelper.RetrieveNewUsers()).Where(u => u.UserName == user.UserName).Select(u => u.Id));
|
||||
Assert.True(UserHelper.Save(user));
|
||||
|
||||
[Fact]
|
||||
public void RetrieveUserByUserName_Ok()
|
||||
{
|
||||
var resetUser = new ResetUser()
|
||||
{
|
||||
UserName = "UnitTest",
|
||||
Reason = "UnitTest",
|
||||
DisplayName = "UnitTest",
|
||||
ResetTime = DateTime.Now
|
||||
};
|
||||
var db = DbManager.Create();
|
||||
db.Save(resetUser);
|
||||
UserHelper.ForgotPassword(new ResetUser() { UserName = user.UserName, DisplayName = user.DisplayName, Reason = "UnitTest", ResetTime = DateTime.Now });
|
||||
Assert.NotNull(UserHelper.RetrieveResetUserByUserName(user.UserName));
|
||||
|
||||
var user = resetUser.RetrieveUserByUserName(resetUser.UserName);
|
||||
Assert.Equal("UnitTest", user.UserName);
|
||||
Assert.Equal("UnitTest", user.DisplayName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DeleteByUserName_Ok()
|
||||
{
|
||||
var resetUser = new ResetUser()
|
||||
{
|
||||
UserName = "UnitTest",
|
||||
Reason = "UnitTest",
|
||||
DisplayName = "UnitTest",
|
||||
ResetTime = DateTime.Now
|
||||
};
|
||||
var db = DbManager.Create();
|
||||
db.Save(resetUser);
|
||||
|
||||
resetUser.DeleteByUserName(resetUser.UserName);
|
||||
var count = db.ExecuteScalar<int>("select count(Id) from ResetUsers");
|
||||
Assert.Equal(0, count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveResetReasonsByUserName_Ok()
|
||||
{
|
||||
var resetUser = new ResetUser()
|
||||
{
|
||||
UserName = "UnitTest",
|
||||
Reason = "UnitTest",
|
||||
DisplayName = "UnitTest",
|
||||
ResetTime = DateTime.Now
|
||||
};
|
||||
var db = DbManager.Create();
|
||||
db.Save(resetUser);
|
||||
|
||||
var reasons = resetUser.RetrieveResetReasonsByUserName(resetUser.UserName);
|
||||
var reasons = UserHelper.RetrieveResetReasonsByUserName(user.UserName);
|
||||
Assert.NotEmpty(reasons);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,15 +9,15 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void SaveRolesByUserId_Ok()
|
||||
{
|
||||
var role = new Role();
|
||||
Assert.True(role.SaveByUserId("1", new string[] { "1", "2" }));
|
||||
var userId = UserHelper.Retrieves().Where(u => u.UserName == "Admin").FirstOrDefault().Id;
|
||||
Assert.True(RoleHelper.SaveByUserId(userId, RoleHelper.Retrieves().Select(r => r.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveRolesByUserId_Ok()
|
||||
{
|
||||
var role = new Role();
|
||||
Assert.NotEmpty(role.RetrievesByUserId("1"));
|
||||
var userId = UserHelper.Retrieves().Where(u => u.UserName == "Admin").FirstOrDefault().Id;
|
||||
Assert.NotEmpty(RoleHelper.RetrievesByUserId(userId));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -28,11 +28,8 @@ namespace Bootstrap.DataAccess
|
|||
Description = "Role_Desc",
|
||||
RoleName = "UnitTest-Delete"
|
||||
};
|
||||
role.Save(role);
|
||||
Assert.True(role.Delete(new string[] { role.Id.ToString() }));
|
||||
|
||||
// clean
|
||||
role.Delete(role.Retrieves().Where(r => r.RoleName == role.RoleName).Select(r => r.Id));
|
||||
Assert.True(RoleHelper.Save(role));
|
||||
Assert.True(RoleHelper.Delete(RoleHelper.Retrieves().Where(r => r.RoleName == role.RoleName).Select(r => r.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -43,53 +40,46 @@ namespace Bootstrap.DataAccess
|
|||
Description = "Role_Desc",
|
||||
RoleName = "UnitTest-Save"
|
||||
};
|
||||
Assert.True(role.Save(role));
|
||||
|
||||
// clean
|
||||
role.Delete(role.Retrieves().Where(r => r.RoleName == role.RoleName).Select(r => r.Id));
|
||||
Assert.True(RoleHelper.Save(role));
|
||||
Assert.True(RoleHelper.Delete(RoleHelper.Retrieves().Where(r => r.RoleName == role.RoleName).Select(r => r.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveRolesByMenuId_Ok()
|
||||
{
|
||||
var menu = new Menu();
|
||||
var role = new Role();
|
||||
var id = role.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
menu.SaveMenusByRoleId(id, new string[] { "1" });
|
||||
var rs = role.RetrievesByMenuId("1");
|
||||
Assert.Contains(rs, r => r.Checked == "checked");
|
||||
var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
MenuHelper.SaveMenusByRoleId(roleId, MenuHelper.RetrieveAllMenus("Admin").Select(m => m.Id));
|
||||
var rs = RoleHelper.RetrievesByMenuId(MenuHelper.RetrieveAllMenus("Admin").FirstOrDefault().Id).Where(r => r.Checked == "checked");
|
||||
Assert.NotEmpty(rs);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SavaRolesByMenuId_Ok()
|
||||
{
|
||||
var role = new Role();
|
||||
Assert.True(role.SavaByMenuId("1", new string[] { "1" }));
|
||||
var menuId = MenuHelper.RetrieveAllMenus("Admin").FirstOrDefault().Id;
|
||||
Assert.True(RoleHelper.SavaByMenuId(menuId, RoleHelper.Retrieves().Select(r => r.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveRolesByGroupId_Ok()
|
||||
{
|
||||
var role = new Role();
|
||||
var id = role.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
new Group().SaveByRoleId(id, new string[] { "1" });
|
||||
Assert.Contains(role.RetrievesByGroupId("1"), r => r.Checked == "checked");
|
||||
var id = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
GroupHelper.SaveByRoleId(id, GroupHelper.Retrieves().Select(g => g.Id));
|
||||
Assert.NotEmpty(RoleHelper.RetrievesByGroupId(GroupHelper.Retrieves().Where(g => g.GroupName == "Admin").FirstOrDefault().Id).Where(r => r.Checked == "checked"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveRolesByUserName_Ok()
|
||||
{
|
||||
var role = new Role();
|
||||
var id = role.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
new User().SaveByRoleId(id, new string[] { "1" });
|
||||
Assert.NotEmpty(role.RetrieveRolesByUserName("Admin"));
|
||||
var id = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
UserHelper.SaveByRoleId(id, UserHelper.Retrieves().Select(u => u.Id));
|
||||
Assert.NotEmpty(RoleHelper.RetrieveRolesByUserName("Admin"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveRolesByUrl_Ok()
|
||||
{
|
||||
var role = new Role();
|
||||
Assert.NotEmpty(role.RetrieveRolesByUrl("~/Home/Index"));
|
||||
Assert.NotEmpty(RoleHelper.RetrieveRolesByUrl("~/Home/Index"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,7 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void Retrieves_Ok()
|
||||
{
|
||||
var t = new Task();
|
||||
Assert.Equal(Enumerable.Empty<Task>(), t.Retrieves());
|
||||
Assert.Equal(Enumerable.Empty<Task>(), TaskHelper.Retrieves());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Longbow.Web.Mvc;
|
||||
using Longbow.Data;
|
||||
using Longbow.Web.Mvc;
|
||||
using System;
|
||||
using Xunit;
|
||||
|
||||
|
@ -20,7 +21,7 @@ namespace Bootstrap.DataAccess
|
|||
LogTime = DateTime.Now,
|
||||
RequestUrl = "~/Home/Index"
|
||||
};
|
||||
Assert.True(log.Save(log));
|
||||
Assert.True(DbContextManager.Create<Trace>().Save(log));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -36,8 +37,8 @@ namespace Bootstrap.DataAccess
|
|||
LogTime = DateTime.Now,
|
||||
RequestUrl = "~/Home/Index"
|
||||
};
|
||||
log.Save(log);
|
||||
Assert.NotEmpty(log.Retrieves(new PaginationOption() { Limit = 20, Offset = 0, Order = "desc", Sort = "LogTime" }, null, null, null).Items);
|
||||
DbContextManager.Create<Trace>().Save(log);
|
||||
Assert.NotEmpty(TraceHelper.Retrieves(new PaginationOption() { Limit = 20, Offset = 0, Order = "desc", Sort = "LogTime" }, null, null, null).Items);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void Authenticate_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.Authenticate("Admin", "123789"));
|
||||
Assert.True(UserHelper.Authenticate("Admin", "123789", u => u.Ip = "::1"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -26,144 +25,126 @@ namespace Bootstrap.DataAccess
|
|||
[Fact]
|
||||
public void Authenticate_Fail()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.False(u.Authenticate("Admin-NotExists", "123789"));
|
||||
Assert.False(UserHelper.Authenticate("Admin-NotExists", "123789", u => u.Ip = "::1"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ChangePassword_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.ChangePassword("Admin", "123789", "123789"));
|
||||
Assert.True(UserHelper.ChangePassword("Admin", "123789", "123789"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public virtual void Retrieves_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.NotEmpty(u.Retrieves());
|
||||
Assert.NotEmpty(UserHelper.Retrieves());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveNewUsers_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
u.Delete(u.RetrieveNewUsers().Select(usr => usr.Id));
|
||||
Assert.Empty(u.RetrieveNewUsers());
|
||||
UserHelper.Delete(UserHelper.RetrieveNewUsers().Select(usr => usr.Id));
|
||||
Assert.Empty(UserHelper.RetrieveNewUsers());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.Update("1", "123789", "Administrator"));
|
||||
var userId = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == "Admin").Id;
|
||||
Assert.True(UserHelper.Update(userId, "123789", "Administrator"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ApproveUser_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
u.Delete(u.Retrieves().Where(usr => usr.UserName == "UnitTest").Select(usr => usr.Id));
|
||||
UserHelper.Delete(UserHelper.Retrieves().Where(usr => usr.UserName == "UnitTest").Select(usr => usr.Id));
|
||||
|
||||
var up = new User() { UserName = "UnitTest", Password = "123", Description = "新建用户用于测试批准", DisplayName = "UnitTest", Icon = "default.jpg" };
|
||||
u.Save(up);
|
||||
Assert.True(u.Approve(up.Id, "UnitTest"));
|
||||
UserHelper.Save(up);
|
||||
Assert.True(UserHelper.Approve(up.Id, "UnitTest"));
|
||||
|
||||
u.Delete(new string[] { up.Id });
|
||||
UserHelper.Delete(UserHelper.Retrieves().Where(u => u.UserName == up.UserName).Select(u => u.Id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveUsersByRoleId_Ok()
|
||||
{
|
||||
var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id;
|
||||
var uid = new User().Retrieves().Where(u => u.UserName == "Admin").First().Id;
|
||||
var db = DbManager.Create();
|
||||
db.Execute("delete from userrole where USERID = @0 and ROLEID = @1", uid, rid);
|
||||
db.Execute("insert into userrole (USERID, ROLEID) values (@0, @1)", uid, rid);
|
||||
var rid = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
var uid = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == "Admin").Id;
|
||||
|
||||
var users = new User().RetrievesByRoleId(rid);
|
||||
Assert.NotEmpty(users);
|
||||
Assert.Contains(users, usr => usr.Checked == "checked");
|
||||
UserHelper.SaveByRoleId(rid, new string[] { uid });
|
||||
|
||||
var users = UserHelper.RetrievesByRoleId(rid);
|
||||
Assert.NotEmpty(users.Where(u => u.Checked == "checked"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrievesByGroupId_Ok()
|
||||
{
|
||||
var gid = new Group().Retrieves().Where(r => r.GroupName == "Admin").First().Id;
|
||||
var u = new User();
|
||||
var users = u.RetrievesByGroupId(gid);
|
||||
Assert.NotEmpty(users);
|
||||
Assert.Contains(users, usr => !usr.Checked.IsNullOrEmpty());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DeleteUser_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.Delete(new string[] { "5", "6" }));
|
||||
var gid = GroupHelper.Retrieves().FirstOrDefault(r => r.GroupName == "Admin").Id;
|
||||
var users = UserHelper.RetrievesByGroupId(gid);
|
||||
Assert.NotEmpty(users.Where(u => u.Checked == "checked"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveUser_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
u.Delete(u.Retrieves().Where(usr => usr.UserName == "UnitTest").Select(usr => usr.Id));
|
||||
Assert.True(u.Save(new User { UserName = "UnitTest", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" }));
|
||||
u.Delete(u.Retrieves().Where(usr => usr.UserName == "UnitTest").Select(usr => usr.Id));
|
||||
var user = new User { UserName = "UnitTestDelete", Password = "123", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" };
|
||||
Assert.True(UserHelper.Save(user));
|
||||
Assert.True(UserHelper.Delete(UserHelper.Retrieves().Where(usr => usr.UserName == user.UserName).Select(usr => usr.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveUserIconByName_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.SaveUserIconByName("Admin", "default.jpg"));
|
||||
Assert.True(UserHelper.SaveUserIconByName("Admin", "default.jpg"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveDisplayName_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.SaveDisplayName("Admin", "Administrator"));
|
||||
Assert.True(UserHelper.SaveDisplayName("Admin", "Administrator"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveUserCssByName_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.SaveUserCssByName("Admin", "default.css"));
|
||||
Assert.True(UserHelper.SaveUserCssByName("Admin", "default.css"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Reject_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
u.UserName = "UnitTest-Reject";
|
||||
u.UserName = "UnitTestReject";
|
||||
u.DisplayName = "DisplayName";
|
||||
u.Description = "Desc";
|
||||
u.Icon = "default.jpg";
|
||||
u.Save(u);
|
||||
Assert.True(u.Reject(u.Id, "Argo"));
|
||||
UserHelper.Delete(UserHelper.RetrieveNewUsers().Union(UserHelper.Retrieves()).Where(usr => usr.UserName == u.UserName).Select(usr => usr.Id));
|
||||
UserHelper.Save(u);
|
||||
Assert.True(UserHelper.Reject(UserHelper.RetrieveNewUsers().FirstOrDefault(usr => usr.UserName == u.UserName).Id, "Argo"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveByGroupId_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.SaveByGroupId("1", new string[] { "1" }));
|
||||
var groupId = GroupHelper.Retrieves().FirstOrDefault(g => g.GroupName == "Admin").Id;
|
||||
var id = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == "Admin").Id;
|
||||
Assert.True(UserHelper.SaveByGroupId(groupId, new string[] { id }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SaveByRoleId_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
Assert.True(u.SaveByRoleId("1", new string[] { "1", "2" }));
|
||||
var roleId = RoleHelper.Retrieves().FirstOrDefault(g => g.RoleName == "Administrators").Id;
|
||||
var id = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == "Admin").Id;
|
||||
Assert.True(UserHelper.SaveByRoleId(roleId, new string[] { id }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RetrieveUserByUserName_Ok()
|
||||
{
|
||||
var u = new User();
|
||||
var usr = u.RetrieveUserByUserName("Admin");
|
||||
var usr = UserHelper.RetrieveUserByUserName("Admin");
|
||||
Assert.Equal("Administrator", usr.DisplayName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ namespace UnitTest
|
|||
|
||||
public static string NpgSqlConnectionString { get; set; }
|
||||
|
||||
public static string MongoDBName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得当前工程解决方案目录
|
||||
/// </summary>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"MongoDB": "UnitTest",
|
||||
"ConnectionStrings": {
|
||||
"sqlite": "Data Source=UnitTest.db;",
|
||||
"sqlserver": "Data Source=.;Initial Catalog=UnitTest;User ID=sa;Password=sa",
|
||||
|
|
Loading…
Reference in New Issue