qinchaoyue 5 сар өмнө
parent
commit
6cac594449

+ 1 - 1
src/Hotline.Application.Tests/Controller/DefaultHttpContextAccessor.cs

@@ -31,7 +31,7 @@ public class DefaultHttpContextAccessor : ISessionContext, IScopeDependency
     public HttpContext? HttpContext { get => GetContext(); set => _content = value; }
 
 
-    public string? OpenId { get { return TestSessionConstants.OpenId; } set { } }
+    public string? OpenId { get; init; }
 
     /// <summary>
     /// Id of current tenant or null for host

+ 1 - 1
src/Hotline.WeChat/Hotline.WeChat.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
   </PropertyGroup>

+ 6 - 0
src/Hotline/Authentications/FakeSessionContext.cs

@@ -44,5 +44,11 @@ namespace Hotline.Authentications
         /// 工号
         /// </summary>
         public string? StaffNo { get; init; }
+
+        /// <summary>
+        /// 第三方平台用户唯一标识
+        /// 例如: 微信的OpenId
+        /// </summary>
+        public string? OpenId { get; init; }
     }
 }

+ 6 - 0
src/Hotline/Authentications/Police110SessionContext.cs

@@ -56,5 +56,11 @@ namespace Hotline.Authentications
         /// 工号
         /// </summary>
         public string? StaffNo { get; init; }
+
+        /// <summary>
+        /// 第三方平台用户唯一标识
+        /// 例如: 微信的OpenId
+        /// </summary>
+        public string? OpenId { get; init; }
     }
 }

+ 6 - 0
src/Hotline/Authentications/ProvinceSessionContext.cs

@@ -61,5 +61,11 @@ namespace Hotline.Authentications
         /// 工号
         /// </summary>
         public string? StaffNo { get; init; }
+
+        /// <summary>
+        /// 第三方平台用户唯一标识
+        /// 例如: 微信的OpenId
+        /// </summary>
+        public string? OpenId { get; init; }
     }
 }

+ 6 - 0
src/Hotline/Authentications/YbEnterpriseSessionContext.cs

@@ -57,5 +57,11 @@ namespace Hotline.Authentications
         /// 工号
         /// </summary>
         public string? StaffNo { get; init; }
+
+        /// <summary>
+        /// 第三方平台用户唯一标识
+        /// 例如: 微信的OpenId
+        /// </summary>
+        public string? OpenId { get; init; }
     }
 }

+ 6 - 0
src/Hotline/Authentications/ZzptSessionContext.cs

@@ -56,5 +56,11 @@ namespace Hotline.Authentications
         /// 工号
         /// </summary>
         public string? StaffNo { get; init; }
+
+        /// <summary>
+        /// 第三方平台用户唯一标识
+        /// 例如: 微信的OpenId
+        /// </summary>
+        public string? OpenId { get; init; }
     }
 }

+ 5 - 1
src/XF.Domain/Authentications/DefaultSessionContext.cs

@@ -78,7 +78,11 @@ namespace XF.Domain.Authentications
         /// </summary>
         public string? StaffNo { get; init; }
 
-        public string? OpenId { get; }
+        /// <summary>
+        /// 第三方平台用户唯一标识
+        /// 例如: 微信的OpenId
+        /// </summary>
+        public string? OpenId { get; init; }
     }
 
     public static class ClaimsPrincipalExtensions

+ 3 - 2
src/XF.Domain/Authentications/ISessionContext.cs

@@ -47,7 +47,8 @@ public interface ISessionContext
     string? StaffNo { get; init; }
 
     /// <summary>
-    /// 微信OpenId
+    /// 第三方平台用户唯一标识
+    /// 例如: 微信的OpenId
     /// </summary>
-    string? OpenId { get; }
+    string? OpenId { get; init; }
 }