From 3906b7b44c77cd124367da2a9768a04e3625abd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 10 Apr 2022 09:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B2=A1=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Infrastructure/OptionsSetting.cs | 2 -- ZR.Admin.WebApi/Framework/JwtUtil.cs | 2 +- ZR.Repository/BaseRepository.cs | 7 ++----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Infrastructure/OptionsSetting.cs b/Infrastructure/OptionsSetting.cs index be68c71..c01060c 100644 --- a/Infrastructure/OptionsSetting.cs +++ b/Infrastructure/OptionsSetting.cs @@ -11,8 +11,6 @@ namespace Infrastructure public static string ConnBus = "conn_bus"; public static string ConnBusDbType = "conn_bus_type"; - public static string DbKey = "DbKey"; - public string Redis { get; set; } public string Database { get; set; } /// diff --git a/ZR.Admin.WebApi/Framework/JwtUtil.cs b/ZR.Admin.WebApi/Framework/JwtUtil.cs index 23dbcc5..3a52795 100644 --- a/ZR.Admin.WebApi/Framework/JwtUtil.cs +++ b/ZR.Admin.WebApi/Framework/JwtUtil.cs @@ -131,7 +131,7 @@ namespace ZR.Admin.WebApi.Framework { var userData = jwtToken.FirstOrDefault(x => x.Type == ClaimTypes.UserData).Value; var loginUser = JsonConvert.DeserializeObject(userData); - var permissions = loginUser.Permissions;//TODO (List)CacheHelper.GetCache(GlobalConstant.UserPermKEY + loginUser?.UserId); + var permissions = (List)CacheHelper.GetCache(GlobalConstant.UserPermKEY + loginUser?.UserId); if (loginUser?.UserName == "admin") { permissions = new List() { GlobalConstant.AdminPerm }; diff --git a/ZR.Repository/BaseRepository.cs b/ZR.Repository/BaseRepository.cs index 7ffe094..9da0605 100644 --- a/ZR.Repository/BaseRepository.cs +++ b/ZR.Repository/BaseRepository.cs @@ -1,12 +1,9 @@ -using Infrastructure.Model; -using SqlSugar; +using SqlSugar; using SqlSugar.IOC; using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Linq.Expressions; -using System.Reflection; using ZR.Model; namespace ZR.Repository @@ -35,7 +32,7 @@ namespace ZR.Repository itenant = DbScoped.SugarScope;//设置租户接口 if (Context == null) { - Context = context ?? DbScoped.SugarScope.GetConnection(1);//根据类传入的ConfigId自动选择 + Context = DbScoped.SugarScope.GetConnection(1);//根据类传入的ConfigId自动选择 } }