Kaynağa Gözat

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

田爽 5 ay önce
ebeveyn
işleme
6158ec1b8f

+ 2 - 1
src/Hotline.Api/Controllers/KnowledgeController.cs

@@ -1196,8 +1196,9 @@ namespace Hotline.Api.Controllers
                 var type = await _knowledgeTypeRepository.GetAsync(x => x.Id == dto.KnowledgeTypeId);
                 typeSpliceName = type?.SpliceName;
             }
-            var (total, items) = await _knowledgeCorrectionRepository.Queryable()
+            var (total, items) = await _knowledgeCorrectionRepository.Queryable(includeDeleted: true)
                 .Includes(x => x.Knowledge)
+                .Where(m => m.IsDeleted == false && m.Knowledge.IsDeleted == false)
                 //.WhereIF(!string.IsNullOrEmpty(dto.KnowledgeTypeId), x => x.Knowledge.KnowledgeTypeId == dto.KnowledgeTypeId!)
                 .WhereIF(!string.IsNullOrEmpty(dto.CreatorName), x => x.CreatorName == dto.CreatorName!)
                  //.WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.Knowledge.KnowledgeType, typeSpliceName))

+ 0 - 12
src/Hotline.Application.Tests/Controller/DefaultSessionContext.cs

@@ -17,13 +17,9 @@ namespace Hotline.Application.Tests.Controller;
 public class DefaultSessionContext : ISessionContext, IScopeDependency
 {
     private readonly IHttpContextAccessor _contextAccessor;
-    private readonly ClaimsPrincipal User;
     public DefaultSessionContext(IHttpContextAccessor httpContextAccessor)
     {
         _contextAccessor = httpContextAccessor;
-        if (_contextAccessor.HttpContext is null) return;
-
-        User = httpContextAccessor.HttpContext.User;
         //Roles = user.Claims.Where(d => d.Type == JwtClaimTypes.Role).Select(d => d.Value).ToArray();
     }
     private HttpContext _content = new DefaultHttpContext();
@@ -31,14 +27,6 @@ public class DefaultSessionContext : ISessionContext, IScopeDependency
     private HttpContext GetContext()
     {
         return _contextAccessor.HttpContext;
-        var context = new DefaultHttpContext();
-        //var openId = new Claim(AppClaimTypes.OpenId, "测试生成的OpenId");
-        var id = new ClaimsIdentity("身份");
-        //id.AddClaim(openId);
-        context.User = new ClaimsPrincipal(id);
-        //OpenId = context.User.FindFirstValue(AppClaimTypes.OpenId);
-        return context;
-
     }
     public HttpContext? HttpContext { get => GetContext(); set => _content = value; }