提交代码
This commit is contained in:
@ -5,7 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.DAL.AuthDbModel;
|
||||
using WCS.DAL.Db.AuthDb;
|
||||
|
||||
namespace WCS.DAL
|
||||
{
|
||||
@ -14,9 +14,11 @@ namespace WCS.DAL
|
||||
/// </summary>
|
||||
public static class AuthDbHelp
|
||||
{
|
||||
|
||||
|
||||
public static SqlSugarScope db = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
ConnectionString = $"Data Source={LocalFile.AuthDbPath};",
|
||||
ConnectionString = $"Data Source={DbPath.AuthDbPath};",
|
||||
DbType = DbType.Sqlite,//[Sqlite]安装[System.Data.SQLite.Core];
|
||||
IsAutoCloseConnection = true
|
||||
}, db =>
|
@ -5,7 +5,7 @@ using System.Text;
|
||||
using WCS.DAL.Db;
|
||||
using WCS.Model;
|
||||
|
||||
namespace WCS.DAL.AuthDbModel
|
||||
namespace WCS.DAL.Db.AuthDb
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户
|
||||
@ -32,7 +32,7 @@ namespace WCS.DAL.AuthDbModel
|
||||
/// 角色名称
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<string> RoleNames { get => (RoleIds == null || !RoleIds.Any()) ? new List<string>() : AuthDbHelp.db.Queryable<RoleBase>().Where(o => RoleIds.Contains(o.Id)).Select(o => o.Name).ToList(); }
|
||||
public List<string> RoleNames { get => RoleIds == null || !RoleIds.Any() ? new List<string>() : AuthDbHelp.db.Queryable<RoleBase>().Where(o => RoleIds.Contains(o.Id)).Select(o => o.Name).ToList(); }
|
||||
/// <summary>
|
||||
/// 是否最大权限
|
||||
/// </summary>
|
||||
@ -70,7 +70,7 @@ namespace WCS.DAL.AuthDbModel
|
||||
/// 认证模块名称
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<string> AuthNames { get => (Auths == null || !Auths.Any()) ? new List<string>() : EnumHelps.GetEnumDescriptionList(typeof(AuthEnum), true).Where(o => Auths.Contains(o.Item1)).Select(o => o.Item3).ToList(); }
|
||||
public List<string> AuthNames { get => Auths == null || !Auths.Any() ? new List<string>() : EnumHelps.GetEnumDescriptionList(typeof(AuthEnum), true).Where(o => Auths.Contains(o.Item1)).Select(o => o.Item3).ToList(); }
|
||||
/// <summary>
|
||||
/// 是否最大权限
|
||||
/// </summary>
|
@ -14,7 +14,7 @@ namespace WCS.DAL.Db
|
||||
/// </summary>
|
||||
public static SqlSugarScope db = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
ConnectionString = $"Data Source={LocalFile.DataDbPath};",
|
||||
ConnectionString = $"Data Source={DbPath.DataDbPath};",
|
||||
DbType = DbType.Sqlite,//[Sqlite]安装[System.Data.SQLite];
|
||||
IsAutoCloseConnection = true
|
||||
}, db =>
|
||||
@ -31,7 +31,7 @@ namespace WCS.DAL.Db
|
||||
/// </summary>
|
||||
public static SqlSugarScope dbLog = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
ConnectionString = $"Data Source={LocalFile.LogDbPath};",
|
||||
ConnectionString = $"Data Source={DbPath.LogDbPath};",
|
||||
DbType = DbType.Sqlite,//[Sqlite]安装[System.Data.SQLite];
|
||||
IsAutoCloseConnection = true
|
||||
}, db =>
|
||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace WCS.DAL
|
||||
{
|
||||
public static class LocalFile
|
||||
public static class DbPath
|
||||
{
|
||||
public static readonly string AppDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
Reference in New Issue
Block a user