Просмотр исходного кода

[trunk] merge from develop:2.1.21

lith 1 год назад
Родитель
Сommit
da71a4259a
94 измененных файлов с 1800 добавлено и 1161 удалено
  1. 2 0
      Publish/DevOps2/jenkins-bash/jenkinsfile.env
  2. 4 4
      Publish/DevOps2/jenkins-bash/library.dev.jenkinsfile
  3. 3 3
      Publish/DevOps2/jenkins-bash/library.preview.jenkinsfile
  4. 4 4
      Publish/DevOps2/jenkins-bash/library.prod.jenkinsfile
  5. 15 0
      Publish/ReleaseFile/docker-deploy/sers/AuthService.Env.js
  6. 44 0
      Publish/ReleaseFile/docker-deploy/sers/docker部署sers-启用vit.sso.md
  7. 16 20
      Publish/ReleaseFile/docker-deploy/sers/docker部署sers.md
  8. 33 32
      dotnet/Gateway/App.Gateway/App.Gateway.csproj
  9. 14 0
      dotnet/Gateway/App.Gateway/appsettings.json
  10. 29 29
      dotnet/Library/Sers/Sers.CL/Ipc/Sers.CL.Ipc.NamedPipe/Sers.CL.Ipc.NamedPipe.csproj
  11. 18 18
      dotnet/Library/Sers/Sers.CL/Ipc/Sers.CL.Ipc.SharedMemory/Sers.CL.Ipc.SharedMemory.csproj
  12. 1 1
      dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryClient.cs
  13. 1 1
      dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryServer.cs
  14. 21 21
      dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Sers.CL.Socket.Iocp.csproj
  15. 18 18
      dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.ThreadWait/Sers.CL.Socket.ThreadWait.csproj
  16. 21 21
      dotnet/Library/Sers/Sers.CL/Test/CommunicationManage/CmClient/CmClient.csproj
  17. 23 23
      dotnet/Library/Sers/Sers.CL/Test/CommunicationManage/CmServer/CmServer.csproj
  18. 21 21
      dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryClient/DeliveryClient.csproj
  19. 21 21
      dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryServer/DeliveryServer.csproj
  20. 18 18
      dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryTest/DeliveryTest.csproj
  21. 21 21
      dotnet/Library/Sers/Sers.CL/WebSocket/Sers.CL.WebSocket/Sers.CL.WebSocket.csproj
  22. 38 38
      dotnet/Library/Sers/Sers.CL/Zmq/FullDuplex/Sers.CL.Zmq.FullDuplex/Sers.CL.Zmq.FullDuplex.csproj
  23. 44 44
      dotnet/Library/Sers/Sers.CL/Zmq/ThreadWait/Sers.CL.ClrZmq.ThreadWait/Sers.CL.ClrZmq.ThreadWait.csproj
  24. 20 20
      dotnet/Library/Sers/Sers.CL/Zmq/ThreadWait/clrzmq4-master/ZeroMQ.netcore.csproj
  25. 75 0
      dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/JsonWebToken.cs
  26. 27 0
      dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj
  27. 117 0
      dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Vit.SSO/JwtValidateService_RS256Base.cs
  28. 22 0
      dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Vit.SSO/UserInfo.cs
  29. 51 51
      dotnet/Library/Sers/Sers.Core/Sers.Core.Temp/Sers.Core.Temp.csproj
  30. 1 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/CL/MessageOrganize/DefaultOrganize/RequestAdaptor.cs
  31. 4 23
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/AccountInCookie/AccountInCookie.cs
  32. 4 4
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Bearer.cs
  33. 0 33
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Extensions/RpcContextDataExtensions.cs
  34. 6 6
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/EventBuilder.cs
  35. 1 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/App/SersApplication.cs
  36. 2 2
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Env/UsageReporter.cs
  37. 2 2
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/Extensions/RpcContextDataExtensions.cs
  38. 31 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/Extensions/RpcContextDataExtensions_Authorization.cs
  39. 44 0
      dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/Extensions/RpcContextDataExtensions_Cookie.cs
  40. 1 1
      dotnet/Library/Sers/Sers.Core/Sers.Core/Sers.Core.csproj
  41. 12 12
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.LocalApi.MsTest/Sers.Core.Module.LocalApi.MsTest.csproj
  42. 13 13
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.LocalApi.Qps/Sers.Core.Module.LocalApi.Qps.csproj
  43. 12 12
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.Rpc.MsTest/Sers.Core.Module.Rpc.MsTest.csproj
  44. 12 16
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.Serialization.Qps/Sers.Core.Module.Serialization.Qps.csproj
  45. 12 12
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.MsTest/Sers.Core.MsTest.csproj
  46. 23 23
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Util.Consumer.Test/Sers.Core.Util.Consumer.Test.csproj
  47. 22 22
      dotnet/Library/Sers/Sers.Gateway/Sers.Gateway/Sers.Gateway.csproj
  48. 23 23
      dotnet/Library/Sers/Sers.Hardware/Sers.Hardware/Sers.Hardware.csproj
  49. 7 7
      dotnet/Library/Sers/Sers.Hardware/Test/Sers.Hardware.Demo/Sers.Hardware.Demo.csproj
  50. 34 33
      dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/Sers.Serslot.csproj
  51. 20 20
      dotnet/Library/Sers/Sers.ServiceStation/Sers.ServiceStation/Sers.ServiceStation.csproj
  52. 19 19
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.MsTest/Vit.Core.MsTest.csproj
  53. 8 11
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Shell.Demo/Vit.Core.Util.Shell.Demo.csproj
  54. 1 1
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Timer/SersTimer_SingleThread_Test.cs
  55. 1 1
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Timer/SersTimer_Test.cs
  56. 11 11
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Vit.Core.Util.Threading.MsTest.csproj
  57. 2 2
      dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/LogCollector/ElasticSearch/Client/ElasticSearchClient.cs
  58. 2 2
      dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/LogCollector/Splunk/Client/SplunkClient.cs
  59. 1 1
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Common/CommonHelp.cs
  60. 1 1
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Timer/VitTimer.cs
  61. 7 7
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Timer/VitTimer_SingleThead.cs
  62. 2 2
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Worker/LongThread_TimeLimit.cs
  63. 2 2
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Worker/ManagedThread.cs
  64. 30 30
      dotnet/Library/Vit/Vit.Core/Vit.Core/Vit.Core.csproj
  65. 22 23
      dotnet/Library/Vit/Vit.Net.Http.FormFile/Vit.Net.Http.FormFile.csproj
  66. 28 28
      dotnet/Library/Vit/Vit.WebHost/Vit.WebHost.csproj
  67. 11 0
      dotnet/Sers.sln
  68. 45 44
      dotnet/ServiceCenter/App.Gover.Gateway/App.Gover.Gateway.csproj
  69. 14 0
      dotnet/ServiceCenter/App.Gover.Gateway/appsettings.json
  70. 6 2
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ActiveApiDoc.html
  71. 6 2
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ApiDoc.html
  72. 6 2
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ApiStation.html
  73. 6 3
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Health.html
  74. 6 2
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/RateLimit.html
  75. 15 0
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/AuthService.Env.js
  76. 175 0
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/AuthService.js
  77. 12 0
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/login.html
  78. 15 0
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/logoff.html
  79. 7 4
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ServiceStation.html
  80. 2 0
      dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/index.html
  81. 41 40
      dotnet/ServiceCenter/App.ServiceCenter/App.ServiceCenter.csproj
  82. 4 2
      dotnet/ServiceCenter/App.ServiceCenter/Program.cs
  83. 42 0
      dotnet/ServiceCenter/App.ServiceCenter/appsettings.json
  84. 18 18
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ApiTrace.Collector.Zipkin/Sers.ApiTrace.Collector.Zipkin.csproj
  85. 2 2
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Extensions/ServiceCenter_GoverExtensions.cs
  86. 18 18
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Sers.Gover.csproj
  87. 2 4
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter/Controllers/ServiceStationController.cs
  88. 28 28
      dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter.csproj
  89. 41 41
      dotnet/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo/Did.SersLoader.Demo.csproj
  90. 10 10
      dotnet/ServiceStation/Demo/SersLoader/Did.SersLoader.HelloWorld/Did.SersLoader.HelloWorld.csproj
  91. 21 21
      dotnet/ServiceStation/Demo/Serslot/Did.Serslot.Demo/Did.Serslot.Demo.csproj
  92. 22 22
      dotnet/ServiceStation/Demo/Serslot/Did.Serslot.HelloWorld/Did.Serslot.HelloWorld.csproj
  93. 17 17
      dotnet/ServiceStation/Demo/Serslot/Did.Serslot.HelloWorld60/Did.Serslot.HelloWorld60.csproj
  94. 43 43
      dotnet/ServiceStation/Demo/StressTest/App.Robot.Station/App.Robot.Station.csproj

+ 2 - 0
Publish/DevOps2/jenkins-bash/jenkinsfile.env

@@ -0,0 +1,2 @@
+APPNAME=Sers
+SVN_PATH=svn://svn.ki.lith.cloud/Sers

+ 4 - 4
Publish/DevOps2/jenkins-bash/library.develop.jenkinsfile → Publish/DevOps2/jenkins-bash/library.dev.jenkinsfile

@@ -10,8 +10,8 @@ pipeline {
     agent any
 
     environment {
-        APPNAME = "Sers"
-        stageName = "develop"
+        //APPNAME = "Sers"
+        stageName = "dev"
         versionSuffix = "-${stageName}${env.build_number}"
 
         basePath = "/root/docker-cache/jenkins/jenkins_home/workspace/${APPNAME}/${stageName}/${env.build_number}"
@@ -19,7 +19,7 @@ pipeline {
         releasePath = "/root/docker-cache/jenkins/jenkins_home/jenkinsReleaseFile/${stageName}/${APPNAME}"
 
 
-        SVN_PATH = "svn://svn.ki.lith.cloud/Sers"
+        //SVN_PATH = "svn://svn.ki.lith.cloud/Sers"
         //svn_USR = "  "
         //svn_PSW = "  "
         svn = credentials("svn_account")
@@ -30,7 +30,7 @@ pipeline {
         //NUGET_KEY = " "
         NUGET_KEY = credentials("nuget_key")
 
-        DOCKER_ImagePrefix = "docker.lith.cloud:8/develop/"
+        DOCKER_ImagePrefix = "docker.lith.cloud:8/${stageName}/"
         DOCKER_Buildx = false
         DOCKER_USERNAME = " "
         DOCKER_PASSWORD = " "

+ 3 - 3
Publish/DevOps2/jenkins-bash/library.preview.jenkinsfile

@@ -10,7 +10,7 @@ pipeline {
     agent any
 
     environment {
-        APPNAME = "Sers"
+        //APPNAME = "Sers"
         stageName = "preview"
         versionSuffix = "-${stageName}${env.build_number}"
 
@@ -19,7 +19,7 @@ pipeline {
         releasePath = "/root/docker-cache/jenkins/jenkins_home/jenkinsReleaseFile/${stageName}/${APPNAME}"
 
 
-        SVN_PATH = "svn://svn.ki.lith.cloud/Sers"
+        //SVN_PATH = "svn://svn.ki.lith.cloud/Sers"
         //svn_USR = "  "
         //svn_PSW = "  "
         svn = credentials("svn_account")
@@ -30,7 +30,7 @@ pipeline {
         //NUGET_KEY = " "
         NUGET_KEY = credentials("nuget_key")
 
-        DOCKER_ImagePrefix = "docker.lith.cloud:8/preview/"
+        DOCKER_ImagePrefix = "docker.lith.cloud:8/${stageName}/"
         DOCKER_Buildx = true
         DOCKER_USERNAME = " "
         DOCKER_PASSWORD = " "

+ 4 - 4
Publish/DevOps2/jenkins-bash/library.production.jenkinsfile → Publish/DevOps2/jenkins-bash/library.prod.jenkinsfile

@@ -10,8 +10,8 @@ pipeline {
     agent any
 
     environment {
-        APPNAME = "Sers"
-        stageName = "production"
+        //APPNAME = "Sers"
+        stageName = "prod"
         versionSuffix = "  "
 
         basePath = "/root/docker-cache/jenkins/jenkins_home/workspace/${APPNAME}/${stageName}/${env.build_number}"
@@ -19,7 +19,7 @@ pipeline {
         releasePath = "/root/docker-cache/jenkins/jenkins_home/jenkinsReleaseFile/${stageName}/${APPNAME}"
 
 
-        SVN_PATH = "svn://svn.ki.lith.cloud/Sers"
+        //SVN_PATH = "svn://svn.ki.lith.cloud/Sers"
         //svn_USR = "  "
         //svn_PSW = "  "
         svn = credentials("svn_account")
@@ -30,7 +30,7 @@ pipeline {
         //NUGET_KEY = " "
         NUGET_KEY = credentials("nuget_key")
 
-        DOCKER_ImagePrefix = "docker.lith.cloud:8/"
+        DOCKER_ImagePrefix = "docker.lith.cloud:8/${stageName}/"
         DOCKER_Buildx = true
         DOCKER_USERNAME = " "
         DOCKER_PASSWORD = " "

+ 15 - 0
Publish/ReleaseFile/docker-deploy/sers/AuthService.Env.js

@@ -0,0 +1,15 @@
+let AuthService_Config = {
+    autoLogin: true,
+    onLoginSuccess: (accessToken) => {
+        // {access_token:'xx',expires_time:'1686857267655'}
+
+        //set token to cookie
+        let expires = new Date(parseInt(accessToken.expires_time));
+        document.cookie = "Authorization=" + escape(accessToken.access_token) + ";path=/;expires=" + expires.toGMTString();
+    },
+    //audience: "http://localhost:4580",
+    loginUrl: '/_gover_/Scripts/Vit.SSO/login.html',
+    //indexUrl: '/',
+    ssoBaseUrl: 'https://sso.lith.cloud:4'
+};
+

+ 44 - 0
Publish/ReleaseFile/docker-deploy/sers/docker部署sers-启用vit.sso.md

@@ -0,0 +1,44 @@
+# docker部署sers-启用vit.sso
+
+
+
+---------------------------------
+# 修改配置文件
+``` json
+      "BeforeCallApi": [
+        {
+          /* 在此Assembly中加载类 */
+          "assemblyFile": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.dll",
+          /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
+          "className": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.JsonWebToken",
+          //在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的Authorization, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+
+          // if token is valid, will set rpcData.caller.source to CallerSource
+          "CallerSource": "Internal",
+          //"issuer": "https://sso.lith.cloud:4",
+          //"audiences": [ "http://localhost:4580" ],
+          "publicKeysDiscovery_Url": "https://sso.lith.cloud:4/oauth2/v1/discovery/keys"
+        }
+      ]
+
+```
+
+
+# 创建容器并运行
+``` bash
+cd /root/docker
+
+cd sers
+docker run --name=sers --restart=always -d \
+-p 4580:4580 -p 4501:4501 \
+-v /etc/localtime:/etc/localtime \
+-v $PWD/appsettings.json:/root/app/appsettings.json \
+-v $PWD/AuthService.Env.js:/root/app/wwwroot/_gover_/Scripts/Vit.SSO/AuthService.Env.js \
+-v $PWD/Logs:/root/app/Logs \
+-v $PWD/Data:/root/app/Data \
+serset/sers
+
+```
+
+
+

+ 16 - 20
Publish/ReleaseFile/docker-deploy/sers/docker部署sers.md

@@ -1,21 +1,16 @@
-#docker部署sers-servicecenter
+# docker部署sers-servicecenter
+
 
- 
 
 ---------------------------------
-#(x.1)文件
+# (x.1)文件
   (x.1)把本文件所在目录中所有文件拷贝到宿主机
   (x.2)修改配置文件 appsettings.json
  
 
 
-#(x.2)创建容器并运行
-(--name 容器名称,可自定义)
-(--restart=always 自动重启)
-(-v /etc/localtime:/etc/localtime)挂载宿主机localtime文件解决容器时间与主机时区不一致的问题
-(-v $PWD/data:/data 将主机中当前目录下的data挂载到容器的/data)
-(--net=host 网络直接使用宿主机网络)(-p 6022:6022 端口映射)
-
+# (x.2)创建容器并运行
+``` bash
 cd /root/docker
 
 cd sers
@@ -29,38 +24,39 @@ serset/sers
 cd ..
 
 
-#精简
+# 精简
 docker run --name=sers --restart=always -d -p 4580:4580 -p 4501:4501 serset/sers
 
 gover     http://ip:4580
 通信端口 tcp://ip:4501
 
+```
 
 
-#(x.3)应用已经运行
+# (x.3)应用已经运行
    可在文件夹ServiceCenter/Logs 中查看日志
 
- 
+
 #---------------------------------------
-#常用命令
+# 常用命令
 
-#查看容器logs
+# 查看容器logs
 docker logs sers
 
-#在容器内执行命令行
+# 在容器内执行命令行
 docker  exec -it sers bash
 
-#停止容器
+# 停止容器
 docker stop sers
 
-#打开容器
+# 打开容器
 docker start sers
 
-#重启容器
+# 重启容器
 docker restart sers
 
 
-#删除容器
+# 删除容器
 docker rm sers -f
 
 

+ 33 - 32
dotnet/Gateway/App.Gateway/App.Gateway.csproj

@@ -1,36 +1,37 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<publish>Gateway</publish>
-		<docker>sers-gateway</docker>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-
-	<ItemGroup>
-		<Content Include="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-
-		<Content Include="contentTypeMap.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
-
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore.App" />
-
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.Gateway\Sers.Gateway\Sers.Gateway.csproj" />
-	</ItemGroup>
+    <PropertyGroup>
+        <publish>Gateway</publish>
+        <docker>sers-gateway</docker>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+        <Version>2.1.21</Version>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+
+    <ItemGroup>
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+
+        <Content Include="contentTypeMap.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.App" />
+
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.Core\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.Gateway\Sers.Gateway\Sers.Gateway.csproj" />
+    </ItemGroup>
 
 </Project>

+ 14 - 0
dotnet/Gateway/App.Gateway/appsettings.json

@@ -156,6 +156,20 @@
           "api_httpMethod": "POST"
         },
 
+        {
+          /* 在此Assembly中加载类 */
+          "assemblyFile": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.dll",
+          /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
+          //"className": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.JsonWebToken",
+          //在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的Authorization, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+
+          // if token is valid, will set rpcData.caller.source to CallerSource
+          "CallerSource": "Internal",
+          //"issuer": "https://sso.lith.cloud:4",
+          //"audiences": [ "http://localhost:4580" ],
+          "publicKeysDiscovery_Url": "https://sso.lith.cloud:4/oauth2/v1/discovery/keys"
+        },
+
         {
           //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
           //"className": "AccountInCookie",

+ 29 - 29
dotnet/Library/Sers/Sers.CL/Ipc/Sers.CL.Ipc.NamedPipe/Sers.CL.Ipc.NamedPipe.csproj

@@ -1,33 +1,33 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Ipc.NamedPipe.xml</DocumentationFile>
-	</PropertyGroup>
-
-
-	<ItemGroup>
-		<Compile Remove="Doc\**" />
-		<EmbeddedResource Remove="Doc\**" />
-		<None Remove="Doc\**" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Ipc.NamedPipe.xml</DocumentationFile>
+    </PropertyGroup>
+
+
+    <ItemGroup>
+        <Compile Remove="Doc\**" />
+        <EmbeddedResource Remove="Doc\**" />
+        <None Remove="Doc\**" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 18 - 18
dotnet/Library/Sers/Sers.CL/Ipc/Sers.CL.Ipc.SharedMemory/Sers.CL.Ipc.SharedMemory.csproj

@@ -1,27 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.19-temp</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.19-temp</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Ipc.SharedMemory.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Ipc.SharedMemory.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<PackageReference Include="SharedMemory" Version="2.2.3" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="SharedMemory" Version="2.2.3" />
+    </ItemGroup>
 
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryClient.cs

@@ -88,7 +88,7 @@ namespace Sers.CL.Socket.Iocp.Mode.Timer
         /// </summary>
         public int sendFlushInterval = 1;
 
-        SersTimer_SingleThread Send_timer = new SersTimer_SingleThread();
+        VitTimer_SingleThread Send_timer = new VitTimer_SingleThread();
 
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]

+ 1 - 1
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Mode/Timer/DeliveryServer.cs

@@ -89,7 +89,7 @@ namespace Sers.CL.Socket.Iocp.Mode.Timer
         /// </summary>
         public int sendFlushInterval = 1;
 
-        SersTimer_SingleThread Send_timer = new SersTimer_SingleThread();
+        VitTimer_SingleThread Send_timer = new VitTimer_SingleThread();
 
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]

+ 21 - 21
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.Iocp/Sers.CL.Socket.Iocp.csproj

@@ -1,30 +1,30 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Socket.Iocp.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Socket.Iocp.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-	</PropertyGroup>
+    <PropertyGroup>
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 18 - 18
dotnet/Library/Sers/Sers.CL/Socket/Sers.CL.Socket.ThreadWait/Sers.CL.Socket.ThreadWait.csproj

@@ -1,28 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Socket.ThreadWait.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Socket.ThreadWait.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 21 - 21
dotnet/Library/Sers/Sers.CL/Test/CommunicationManage/CmClient/CmClient.csproj

@@ -1,28 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<Content Include="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-		<Content Include="StartConsole.bat">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+    <ItemGroup>
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+        <Content Include="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+    </ItemGroup>
 
 </Project>

+ 23 - 23
dotnet/Library/Sers/Sers.CL/Test/CommunicationManage/CmServer/CmServer.csproj

@@ -1,31 +1,31 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<Content Include="StartConsole.bat">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+    <ItemGroup>
+        <Content Include="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
-	<ItemGroup>
-		<None Update="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+    <ItemGroup>
+        <None Update="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+    </ItemGroup>
 
 </Project>

+ 21 - 21
dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryClient/DeliveryClient.csproj

@@ -1,28 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-	</PropertyGroup>
+    <PropertyGroup>
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<None Update="StartConsole.bat">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+    <ItemGroup>
+        <None Update="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
 </Project>

+ 21 - 21
dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryServer/DeliveryServer.csproj

@@ -1,28 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-	</PropertyGroup>
+    <PropertyGroup>
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<None Update="StartConsole.bat">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+    <ItemGroup>
+        <None Update="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
 </Project>

+ 18 - 18
dotnet/Library/Sers/Sers.CL/Test/MessageDelivery/DeliveryTest/DeliveryTest.csproj

@@ -1,25 +1,25 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<Content Include="dotnet_start.bat">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+    <ItemGroup>
+        <Content Include="dotnet_start.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\..\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\..\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+    </ItemGroup>
 
 </Project>

+ 21 - 21
dotnet/Library/Sers/Sers.CL/WebSocket/Sers.CL.WebSocket/Sers.CL.WebSocket.csproj

@@ -1,32 +1,32 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.WebSocket.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.WebSocket.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<PackageReference Include="Fleck" Version="1.2.0" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Fleck" Version="1.2.0" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 38 - 38
dotnet/Library/Sers/Sers.CL/Zmq/FullDuplex/Sers.CL.Zmq.FullDuplex/Sers.CL.Zmq.FullDuplex.csproj

@@ -1,47 +1,47 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-		<Version>2.1.19-temp</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+        <Version>2.1.19-temp</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Zmq.FullDuplex.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.Zmq.FullDuplex.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 
-	<ItemGroup>
-		<None Update="libsodium.dll">
-			<Pack>true</Pack>
-			<PackageCopyToOutput>true</PackageCopyToOutput>
-			<CopyToOutputDirectory>Never</CopyToOutputDirectory>
-		</None>
-		<None Update="libzmq.dll">
-			<Pack>true</Pack>
-			<PackageCopyToOutput>true</PackageCopyToOutput>
-			<CopyToOutputDirectory>Never</CopyToOutputDirectory>
-		</None>
-		<None Update="libzmq.dylib">
-			<Pack>true</Pack>
-			<PackageCopyToOutput>true</PackageCopyToOutput>
-			<CopyToOutputDirectory>Never</CopyToOutputDirectory>
-		</None>
-		<None Update="libzmq.so">
-			<Pack>true</Pack>
-			<PackageCopyToOutput>true</PackageCopyToOutput>
-			<CopyToOutputDirectory>Never</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+    <ItemGroup>
+        <None Update="libsodium.dll">
+            <Pack>true</Pack>
+            <PackageCopyToOutput>true</PackageCopyToOutput>
+            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+        </None>
+        <None Update="libzmq.dll">
+            <Pack>true</Pack>
+            <PackageCopyToOutput>true</PackageCopyToOutput>
+            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+        </None>
+        <None Update="libzmq.dylib">
+            <Pack>true</Pack>
+            <PackageCopyToOutput>true</PackageCopyToOutput>
+            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+        </None>
+        <None Update="libzmq.so">
+            <Pack>true</Pack>
+            <PackageCopyToOutput>true</PackageCopyToOutput>
+            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
 </Project>

+ 44 - 44
dotnet/Library/Sers/Sers.CL/Zmq/ThreadWait/Sers.CL.ClrZmq.ThreadWait/Sers.CL.ClrZmq.ThreadWait.csproj

@@ -1,59 +1,59 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.19-temp</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.19-temp</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-通信层</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-通信层</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.ClrZmq.ThreadWait.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.CL.ClrZmq.ThreadWait.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<Compile Remove="SocketPoller.cs" />
-		<Compile Remove="SocketPoller2.cs" />
-		<Compile Remove="SocketPoller3.cs" />
-	</ItemGroup>
+    <ItemGroup>
+        <Compile Remove="SocketPoller.cs" />
+        <Compile Remove="SocketPoller2.cs" />
+        <Compile Remove="SocketPoller3.cs" />
+    </ItemGroup>
 
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 
-	<ItemGroup>
-		<Reference Include="ZeroMQ">
-			<HintPath>ZeroMQ.dll</HintPath>
-		</Reference>
-	</ItemGroup>
+    <ItemGroup>
+        <Reference Include="ZeroMQ">
+            <HintPath>ZeroMQ.dll</HintPath>
+        </Reference>
+    </ItemGroup>
 
 
-	<ItemGroup>
-		<None Update="libsodium.dll">
-			<Pack>true</Pack>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-		<None Update="libzmq.dll">
-			<Pack>true</Pack>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-		<None Update="libzmq.dylib">
-			<Pack>true</Pack>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-		<None Update="libzmq.so">
-			<Pack>true</Pack>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-		<!--<None Update="ZeroMQ.dll">
+    <ItemGroup>
+        <None Update="libsodium.dll">
+            <Pack>true</Pack>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+        <None Update="libzmq.dll">
+            <Pack>true</Pack>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+        <None Update="libzmq.dylib">
+            <Pack>true</Pack>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+        <None Update="libzmq.so">
+            <Pack>true</Pack>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+        <!--<None Update="ZeroMQ.dll">
       <Pack>true</Pack>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
@@ -61,7 +61,7 @@
       <Pack>true</Pack>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>-->
-	</ItemGroup>
+    </ItemGroup>
 
 
 </Project>

+ 20 - 20
dotnet/Library/Sers/Sers.CL/Zmq/ThreadWait/clrzmq4-master/ZeroMQ.netcore.csproj

@@ -1,25 +1,25 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>netstandard2.0</TargetFramework>
-	<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-	<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
-	<RootNamespace>ZeroMQ</RootNamespace>
-	<AssemblyName>ZeroMQ</AssemblyName>
-	<AssemblyOriginatorKeyFile>ZeroMQ.snk</AssemblyOriginatorKeyFile>
-    <DefaultItemExcludes>$(DefaultItemExcludes);AssemblyInfo.cs;ZGuideExamples\**\*</DefaultItemExcludes>
-  </PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+        <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+        <RootNamespace>ZeroMQ</RootNamespace>
+        <AssemblyName>ZeroMQ</AssemblyName>
+        <AssemblyOriginatorKeyFile>ZeroMQ.snk</AssemblyOriginatorKeyFile>
+        <DefaultItemExcludes>$(DefaultItemExcludes);AssemblyInfo.cs;ZGuideExamples\**\*</DefaultItemExcludes>
+    </PropertyGroup>
 
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType></DebugType>
-  </PropertyGroup>
-  <PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(TargetFramework)', '^netstandard\d'))">
-    <DefineConstants>NETSTANDARD</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(TargetFramework)', '^netcoreapp\d'))">
-    <DefineConstants>NETCORE</DefineConstants>
-  </PropertyGroup>
+    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    </PropertyGroup>
+    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+        <DebugType></DebugType>
+    </PropertyGroup>
+    <PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(TargetFramework)', '^netstandard\d'))">
+        <DefineConstants>NETSTANDARD</DefineConstants>
+    </PropertyGroup>
+    <PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(TargetFramework)', '^netcoreapp\d'))">
+        <DefineConstants>NETCORE</DefineConstants>
+    </PropertyGroup>
 
 </Project>

+ 75 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/JsonWebToken.cs

@@ -0,0 +1,75 @@
+using Newtonsoft.Json.Linq;
+using Sers.Core.Module.Rpc;
+using System;
+using Sers.Core.Module.Message;
+using Vit.Core.Module.Log;
+using Vit.Extensions;
+using Vit.Extensions.Json_Extensions;
+using Vit.Extensions.Newtonsoft_Extensions;
+using Vit.SSO.Service.RS256;
+
+namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken
+{
+    /// <summary>
+    /// 在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的token, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+    /// </summary>
+    public class JsonWebToken : IBeforeCallApi
+    {
+
+        // if true,when token is invalid,will block the request and return 401
+        //"BlockIfInvalid": false,
+        //bool? BlockIfInvalid;
+
+  
+        string CallerSource;
+        JwtValidateService_RS256Base jwtService;
+
+        public void Init(JObject config)
+        { 
+            CallerSource = config["CallerSource"]?.Value<String>(); 
+            jwtService = config.Deserialize<JwtValidateService_RS256Base>();
+        }
+
+
+
+
+        /// <summary>
+        /// Bearer。 转换at为对应的用户
+        /// </summary>
+        /// <param name="rpcData"></param>
+        /// <param name="requestMessage"></param>
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+        public void BeforeCallApi(RpcContextData rpcData, ApiMessage requestMessage)
+        {
+            try
+            {
+                if (null != rpcData.user) return;
+
+                // #1 get token
+                var token = rpcData.Authorization_Get();
+                if (string.IsNullOrWhiteSpace(token))
+                    token = rpcData.Cookie_Get("Authorization");
+                if (string.IsNullOrWhiteSpace(token))
+                    return;
+
+                // #2 ValidateToken
+                var userInfo = jwtService.ValidateToken(token);
+
+                // #3 set rpcData.user
+                if (null != userInfo)
+                {
+                    if (!string.IsNullOrWhiteSpace(CallerSource))
+                    {
+                        rpcData.caller.source = CallerSource;
+                    }
+                    rpcData.user = new { userInfo = userInfo.Claims };
+                    requestMessage.rpcContextData_OriData = ArraySegmentByteExtensions.Null;
+                }
+            }
+            catch (Exception ex)
+            {
+                Logger.Error(ex);
+            }
+        }
+    }
+}

+ 27 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj

@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers - jwt validate</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.31.0" />
+        <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.31.0" />
+    </ItemGroup>
+
+</Project>

+ 117 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Vit.SSO/JwtValidateService_RS256Base.cs

@@ -0,0 +1,117 @@
+#region << version 1.3 >>
+/* ========================================================================
+ * Author  : Lith
+ * Version : 1.3
+ * Date    : 2023-06-18
+ * Email   : serset@yeah.net
+ * ======================================================================== */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.IdentityModel.Tokens.Jwt;
+using System.Linq;
+using System.Net.Http;
+
+using Microsoft.IdentityModel.Tokens;
+
+using Vit.Core.Module.Log;
+using Vit.Extensions.Json_Extensions;
+using Vit.SSO.Model;
+
+namespace Vit.SSO.Service.RS256
+{
+    public class JwtValidateService_RS256Base
+    {
+        public string issuer { get; set; }
+
+        public List<string> audiences { get; set; }
+
+        public string publicKeysDiscovery_Url { get; set; }
+
+        public List<JsonWebKey> GetPublicJsonWebKeysByUrl()
+        {
+            if (!string.IsNullOrWhiteSpace(publicKeysDiscovery_Url))
+            {
+
+                using (var client = new HttpClient())
+                {
+                    var strPublicKey = client.GetStringAsync(publicKeysDiscovery_Url).Result;
+                    var jwkList = strPublicKey.Deserialize<List<JsonWebKey>>();
+                    return jwkList;
+                }
+            }
+            return null;
+        }
+
+
+
+        protected SecurityKey _publicSecurityKey = null;
+        protected virtual SecurityKey GetPublicSecurityKey()
+        {
+            if (_publicSecurityKey == null)
+            {
+                if (!string.IsNullOrWhiteSpace(publicKeysDiscovery_Url))
+                {
+                    try
+                    {
+                        var jwkList = GetPublicJsonWebKeysByUrl();
+                        var jwk = jwkList?.FirstOrDefault();
+
+                        var _credentials = new SigningCredentials(jwk, SecurityAlgorithms.RsaSha256, SecurityAlgorithms.Sha256);
+                        _publicSecurityKey = _credentials.Key;
+                    }
+                    catch (Exception ex)
+                    {
+                        Logger.Error(ex);
+                    }
+                }
+            }
+            return _publicSecurityKey;
+        }
+
+
+        public UserInfo ValidateToken(string token, List<string> audiences = null)
+        {
+            //#1 get validation config
+            var securityKey = GetPublicSecurityKey();
+            var parameters = new TokenValidationParameters
+            {
+                ValidateIssuerSigningKey = true,
+                IssuerSigningKey = securityKey,
+                ValidateIssuer = false,
+                ValidateAudience = false,
+                ClockSkew = TimeSpan.Zero
+            };
+            if (issuer != null)
+            {
+                parameters.ValidateIssuer = true;
+                parameters.ValidIssuer = issuer;
+            }
+
+            //#2 validate token
+            var tokenHandler = new JwtSecurityTokenHandler();
+            var jwt = tokenHandler.ValidateToken(token, parameters, out var securityToken);
+            var jwtToken = securityToken as JwtSecurityToken;
+
+            //#3 validate Audience
+            if (audiences == null) audiences = this.audiences;
+            if (audiences?.Any() == true)
+            {
+                if (!jwtToken.Audiences.Any(a => audiences.Contains(a.ToString(), StringComparer.OrdinalIgnoreCase)))
+                {
+                    throw new SecurityTokenValidationException($"Token contains invalid audience.");
+                }
+            }
+
+            //#4 get userInfo
+            return new UserInfo
+            {
+                Claims = jwtToken.Claims.ToDictionary(x => x.Type, x => x.Value),
+                Audiences = jwtToken.Audiences,
+                Issuer = jwtToken.Issuer,
+                ValidTo = jwtToken.ValidTo
+            };
+        }
+    }
+}

+ 22 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Vit.SSO/UserInfo.cs

@@ -0,0 +1,22 @@
+#region << version 1.3 >>
+/* ========================================================================
+ * Author  : Lith
+ * Version : 1.3
+ * Date    : 2023-06-18
+ * Email   : serset@yeah.net
+ * ======================================================================== */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace Vit.SSO.Model
+{
+    public class UserInfo
+    {
+        public Dictionary<string, string> Claims { get; set; }
+        public IEnumerable<string> Audiences { get; set; }
+        public string Issuer { get; set; }
+        public DateTime ValidTo { get; set; }
+    }
+}

+ 51 - 51
dotnet/Library/Sers/Sers.Core/Sers.Core.Temp/Sers.Core.Temp.csproj

@@ -1,55 +1,55 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>netstandard2.0</TargetFramework>
-  </PropertyGroup>
-  
-  <PropertyGroup>
-    <Authors>Lith</Authors>
-    <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-    <Description>Send email to serset@yeah.net if you have any questions.</Description>
-  </PropertyGroup>
-  
-  <PropertyGroup>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <DocumentationFile>bin\Debug\netstandard2.0\Sers.Core.Temp.xml</DocumentationFile>
-  </PropertyGroup>
-  
-  <ItemGroup>
-    <Compile Remove="Sers.Core\Util\Consumer\**" />
-    <Compile Remove="SersLoader\ApiDesc\Attribute\Valid\delete\**" />
-    <Compile Remove="Vit.Core\Extensions\byte\**" />
-    <EmbeddedResource Remove="Sers.Core\Util\Consumer\**" />
-    <EmbeddedResource Remove="SersLoader\ApiDesc\Attribute\Valid\delete\**" />
-    <EmbeddedResource Remove="Vit.Core\Extensions\byte\**" />
-    <None Remove="Sers.Core\Util\Consumer\**" />
-    <None Remove="SersLoader\ApiDesc\Attribute\Valid\delete\**" />
-    <None Remove="Vit.Core\Extensions\byte\**" />
-  </ItemGroup>
-
- 
- 
-  <ItemGroup>
-    <PackageReference Include="MessagePack" Version="2.2.85" />
-    <PackageReference Include="Disruptor" Version="4.0.0" /> 
-    <PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" />
-  </ItemGroup>
-
- 
- 
-  <ItemGroup>
-    <ProjectReference Include="..\Sers.Core\Sers.Core.csproj" />
-  </ItemGroup>
-
- 
- 
-  <ItemGroup>
-    <Folder Include="Sers.Core\Util\" />
-    <Folder Include="Vit.Core\Extensions\" />
-  </ItemGroup>
-
- 
- 
- 
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+        <Description>Send email to serset@yeah.net if you have any questions.</Description>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Core.Temp.xml</DocumentationFile>
+    </PropertyGroup>
+
+    <ItemGroup>
+        <Compile Remove="Sers.Core\Util\Consumer\**" />
+        <Compile Remove="SersLoader\ApiDesc\Attribute\Valid\delete\**" />
+        <Compile Remove="Vit.Core\Extensions\byte\**" />
+        <EmbeddedResource Remove="Sers.Core\Util\Consumer\**" />
+        <EmbeddedResource Remove="SersLoader\ApiDesc\Attribute\Valid\delete\**" />
+        <EmbeddedResource Remove="Vit.Core\Extensions\byte\**" />
+        <None Remove="Sers.Core\Util\Consumer\**" />
+        <None Remove="SersLoader\ApiDesc\Attribute\Valid\delete\**" />
+        <None Remove="Vit.Core\Extensions\byte\**" />
+    </ItemGroup>
+
+
+
+    <ItemGroup>
+        <PackageReference Include="MessagePack" Version="2.2.85" />
+        <PackageReference Include="Disruptor" Version="4.0.0" />
+        <PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" />
+    </ItemGroup>
+
+
+
+    <ItemGroup>
+        <ProjectReference Include="..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
+
+
+
+    <ItemGroup>
+        <Folder Include="Sers.Core\Util\" />
+        <Folder Include="Vit.Core\Extensions\" />
+    </ItemGroup>
+
+
+
+
 
 </Project>

+ 1 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/CL/MessageOrganize/DefaultOrganize/RequestAdaptor.cs

@@ -442,7 +442,7 @@ namespace Sers.Core.CL.MessageOrganize.DefaultOrganize
 
         #region (x.6)HeartBeat
 
-        readonly SersTimer heartBeat_Timer = new SersTimer();
+        readonly VitTimer heartBeat_Timer = new VitTimer();
 
         /// <summary>
         /// 

+ 4 - 23
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/AccountInCookie/AccountInCookie.cs

@@ -65,35 +65,16 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.AccountInCookie
             try
             {
                 #region (x.x.x.1)获取cookie 中的用户令牌
-                var cookie = rpcData.http.GetHeader("Cookie");
-                if (string.IsNullOrEmpty(cookie)) return;
-
-                string authUserFromCookie = null;
-                {
-                    // "a=b;c=7"
-                    string str = cookie;
-                    char entrySeparator = ';';
-                    char kvSeparator = '=';
-                    Dictionary<string, string> dictionary;
-                    {
-                        //dictionary = str.Split(new string[] { entrySeparator }, StringSplitOptions.RemoveEmptyEntries)
-                        //    .GroupBy(x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[0], x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[1])
-                        //    .ToDictionary(x => x.Key, x => x.First());
-                        dictionary = str.Split(new[] { entrySeparator }, StringSplitOptions.RemoveEmptyEntries)
-                           //.GroupBy(x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[0], x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[1])
-                           .Select(x => x.Split(new[] { kvSeparator })).ToDictionary(kv => kv[0]?.Trim(), kv => kv[1]?.Trim());
-                    } 
-
-                    authUserFromCookie = dictionary.TryGetValue("user", out var v) ? v : null;
-                }
+                string authUserFromCookie = rpcData.Cookie_Get("user");
+                if (string.IsNullOrEmpty(authUserFromCookie)) return;
                 #endregion
 
                 #region (x.x.x.2) 转换用户身份并写入 rpcData
-                if ( authUserFromCookie != null && userMap.TryGetValue(authUserFromCookie, out var account))
+                if (userMap.TryGetValue(authUserFromCookie, out var account))
                 {
                     if (account.CallerSource != null)
                     {
-                        rpcData.caller.source=account.CallerSource;
+                        rpcData.caller.source = account.CallerSource;
                     }
                     if (account.userInfo != null)
                     {

+ 4 - 4
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Bearer.cs

@@ -12,10 +12,10 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.Bearer
     /// <summary>
     /// 在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),并作为参数调用接口api_verifyAt,把返回数据放到 rpcData.user.userInfo
     /// </summary>
-    public class Bearer: IBeforeCallApi
+    public class Bearer : IBeforeCallApi
     {
         public void Init(JObject config)
-        {   
+        {
             Api_verifyAt = config["api_verifyAt"].Value<String>();
 
             Api_httpMethod = config["api_httpMethod"].Value<String>();
@@ -47,7 +47,7 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.Bearer
             try
             {
                 #region Bearer 转换为对应的用户
-                var bear = rpcData.Bearer_Get();
+                var bear = rpcData.Authorization_Get();
                 if (string.IsNullOrWhiteSpace(bear))
                     return;
 
@@ -56,7 +56,7 @@ namespace Sers.Core.Module.Api.ApiEvent.BeforeCallApi.Bearer
                 ApiReturn<Object> ret;
                 using (var rpcContext = new RpcContext())
                 {
-                    //RpcContext.Current.rpcData=rpcData;
+                    //RpcContext.Current.rpcData = rpcData;
                     rpcContext.rpcData = rpcData;
                     ret = VerifyAt(bear);
                 }

+ 0 - 33
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/BeforeCallApi/Bearer/Extensions/RpcContextDataExtensions.cs

@@ -1,33 +0,0 @@
-using Sers.Core.Module.Rpc;
-
-namespace Vit.Extensions
-{
-    /// <summary>
-    /// Extension methods for RpcContextData
-    /// </summary>
-    public static partial class RpcContextDataExtensions
-    {
-
-        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
-        public static string Bearer_Get(this RpcContextData rpcData)
-        {
-            //http.headers.Authorization = "Bearer atxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- 
-
-            var Authorization =   (rpcData.http.GetHeader("Authorization") ?? rpcData.http.GetHeader("authorization")) ;
-            if (null == Authorization) return null;
-            var bear = (Authorization+ " ").Split(' ')[1];           
-            return bear;
-        }
-
-        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
-        public static void Bearer_Set(this RpcContextData rpcData, string value)
-        {
-            if (null == rpcData || string.IsNullOrWhiteSpace(value)) return;
-            
-            rpcData.http.Headers()["Authorization"] = "Bearer "+value;
-        } 
-   
-
-    }
-}

+ 6 - 6
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Api/ApiEvent/EventBuilder.cs

@@ -26,7 +26,7 @@ namespace Sers.Core.Module.Api.ApiEvent
         {
             if (events == null || events.Count == 0) return null;
 
-            Action<RpcContextData, ApiMessage> BeforeCallApi = null;           
+            Action<RpcContextData, ApiMessage> BeforeCallApi = null;
 
             foreach (JObject config in events)
             {
@@ -76,7 +76,7 @@ namespace Sers.Core.Module.Api.ApiEvent
                     return null;
                 }
 
-                return ObjectLoader.CreateInstance(className, assemblyFile: assemblyFile) as IBeforeCallApi;                
+                return ObjectLoader.CreateInstance(className, assemblyFile: assemblyFile) as IBeforeCallApi;
             }
             #endregion
         }
@@ -92,8 +92,8 @@ namespace Sers.Core.Module.Api.ApiEvent
         /// <param name="events"></param>
         /// <returns></returns>
         public static IEnumerable<IApiScopeEvent> LoadEvent_OnCreateScope(JArray events)
-        {       
-            if (events == null || events.Count == 0) yield break;     
+        {
+            if (events == null || events.Count == 0) yield break;
 
             IApiScopeEvent item;
             foreach (JObject config in events)
@@ -116,7 +116,7 @@ namespace Sers.Core.Module.Api.ApiEvent
                 //(x.x.3) return
                 yield return item;
             }
-        
+
 
             #region GetInstance
             IApiScopeEvent GetInstance(JObject config)
@@ -129,7 +129,7 @@ namespace Sers.Core.Module.Api.ApiEvent
                 if (string.IsNullOrEmpty(className)) return null;
 
                 //(x.2)CreateInstance
-                return ObjectLoader.CreateInstance(className, assemblyFile: assemblyFile) as IApiScopeEvent; 
+                return ObjectLoader.CreateInstance(className, assemblyFile: assemblyFile) as IApiScopeEvent;
             }
             #endregion
         }

+ 1 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/App/SersApplication.cs

@@ -23,7 +23,7 @@ namespace Sers.Core.Module.App
 
 
         #region timer for System.GC.Collect();
-        static SersTimer gcTimer = new SersTimer()
+        static VitTimer gcTimer = new VitTimer()
         {
             intervalMs = 10000,
             timerCallback = (e) =>

+ 2 - 2
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Env/UsageReporter.cs

@@ -34,14 +34,14 @@ namespace Sers.Core.Module.Env
             }
         }
 
-        static SersTimer timer = null;
+        static VitTimer timer = null;
         /// <summary>
         /// 开启自动上报Usage任务
         /// </summary>
         public static void StartReportTask(double intervalSecond)
         {
             if (null != timer) return;
-            timer = new SersTimer { 
+            timer = new VitTimer { 
                 intervalMs = (int)(intervalSecond * 1000),
                 timerCallback =
                 (object obj) =>

+ 2 - 2
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/Extensions/RpcContextDataExtensions.cs

@@ -167,7 +167,7 @@ namespace Vit.Extensions
 
 
 
-        #region ContentType
+        #region http_header_ContentType
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static String http_header_ContentType_Get(this RpcContextData data)
         {
@@ -182,7 +182,7 @@ namespace Vit.Extensions
         }
         #endregion
 
-        #region ContentType
+        #region http_header
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static String http_header_Get(this RpcContextData data, string key)
         {

+ 31 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/Extensions/RpcContextDataExtensions_Authorization.cs

@@ -0,0 +1,31 @@
+using Sers.Core.Module.Rpc;
+
+namespace Vit.Extensions
+{
+    /// <summary>
+    /// Extension methods for RpcContextData
+    /// </summary>
+    public static partial class RpcContextDataExtensions_Authorization
+    {
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+        public static string Authorization_Get(this RpcContextData rpcData)
+        {
+            //http.headers.Authorization = "Bearer atxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+            var Authorization = (rpcData.http_header_Get("Authorization") ?? rpcData.http_header_Get("authorization"));
+            if (null == Authorization) return null;
+            var token = (Authorization + " ").Split(' ')[1];
+            return token;
+        }
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+        public static void Authorization_Set(this RpcContextData rpcData, string token)
+        {
+            if (null == rpcData || string.IsNullOrWhiteSpace(token)) return;
+
+            rpcData.http_header_Set("Authorization", "Bearer " + token);
+        }
+
+
+    }
+}

+ 44 - 0
dotnet/Library/Sers/Sers.Core/Sers.Core/Module/Rpc/Extensions/RpcContextDataExtensions_Cookie.cs

@@ -0,0 +1,44 @@
+using System.Collections.Generic;
+using System;
+
+using Sers.Core.Module.Rpc;
+using System.Linq;
+
+namespace Vit.Extensions
+{
+    /// <summary>
+    /// Extension methods for RpcContextData
+    /// </summary>
+    public static partial class RpcContextDataExtensions_Cookie
+    {
+
+        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+        public static string Cookie_Get(this RpcContextData rpcData, string cookieKey)
+        {
+            // #1
+            var cookie = rpcData.http_header_Get("Cookie");
+            if (string.IsNullOrEmpty(cookie)) return null;
+
+
+            // #2
+            // "a=b;c=7"
+            string str = cookie;
+            char entrySeparator = ';';
+            char kvSeparator = '=';
+            Dictionary<string, string> dictionary;
+            {
+                //dictionary = str.Split(new string[] { entrySeparator }, StringSplitOptions.RemoveEmptyEntries)
+                //    .GroupBy(x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[0], x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[1])
+                //    .ToDictionary(x => x.Key, x => x.First());
+                dictionary = str.Split(new[] { entrySeparator }, StringSplitOptions.RemoveEmptyEntries)
+                   //.GroupBy(x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[0], x => x.Split(new string[] { kvSeparator }, StringSplitOptions.None)[1])
+                   .Select(x => x.Split(new[] { kvSeparator })).ToDictionary(kv => kv[0]?.Trim(), kv => kv[1]?.Trim());
+            }
+            return dictionary.TryGetValue(cookieKey, out var v) ? v : null;
+
+        }
+
+
+
+    }
+}

+ 1 - 1
dotnet/Library/Sers/Sers.Core/Sers.Core/Sers.Core.csproj

@@ -7,7 +7,7 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.21-preview19</Version>
+        <Version>2.1.21</Version>
     </PropertyGroup>
 
     <PropertyGroup>

+ 12 - 12
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.LocalApi.MsTest/Sers.Core.Module.LocalApi.MsTest.csproj

@@ -1,19 +1,19 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
 
-    <IsPackable>false</IsPackable>
-  </PropertyGroup>
+        <IsPackable>false</IsPackable>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-    <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-    <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
-  </ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 13 - 13
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.LocalApi.Qps/Sers.Core.Module.LocalApi.Qps.csproj

@@ -1,20 +1,20 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
- 
 
-  <ItemGroup>
-    <None Update="StartConsole.bat">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
+
+    <ItemGroup>
+        <None Update="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
 </Project>

+ 12 - 12
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.Rpc.MsTest/Sers.Core.Module.Rpc.MsTest.csproj

@@ -1,19 +1,19 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
 
-    <IsPackable>false</IsPackable>
-  </PropertyGroup>
+        <IsPackable>false</IsPackable>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-    <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-    <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
-  </ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 12 - 16
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.Serialization.Qps/Sers.Core.Module.Serialization.Qps.csproj

@@ -1,23 +1,19 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\Sers.Core.Temp\Sers.Core.Temp.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.Core.Temp\Sers.Core.Temp.csproj" />
+    </ItemGroup>
 
- 
- 
 
- 
-
-  <ItemGroup>
-    <None Update="StartConsole.bat">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
+    <ItemGroup>
+        <None Update="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
 </Project>

+ 12 - 12
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.MsTest/Sers.Core.MsTest.csproj

@@ -1,19 +1,19 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
 
-    <IsPackable>false</IsPackable>
-  </PropertyGroup>
+        <IsPackable>false</IsPackable>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-    <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-    <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
-  </ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 23 - 23
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Util.Consumer.Test/Sers.Core.Util.Consumer.Test.csproj

@@ -1,27 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Content Include="StartConsole.bat">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
- 
-
-  <ItemGroup>
-    <PackageReference Include="System.Threading.Channels" Version="5.0.0" />
-  </ItemGroup>
- 
-
-  <ItemGroup>
-    <ProjectReference Include="..\..\Sers.Core.Temp\Sers.Core.Temp.csproj" />
-    <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
-  </ItemGroup> 
- 
- 
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
+
+    <ItemGroup>
+        <Content Include="StartConsole.bat">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+
+    <ItemGroup>
+        <PackageReference Include="System.Threading.Channels" Version="5.0.0" />
+    </ItemGroup>
+
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.Core.Temp\Sers.Core.Temp.csproj" />
+        <ProjectReference Include="..\..\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
+
+
 
 </Project>

+ 22 - 22
dotnet/Library/Sers/Sers.Gateway/Sers.Gateway/Sers.Gateway.csproj

@@ -1,33 +1,33 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-网关</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-网关</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.Gateway.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Gateway.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Vit\Vit.WebHost\Vit.WebHost.csproj" />
-		<ProjectReference Include="..\..\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Vit\Vit.WebHost\Vit.WebHost.csproj" />
+        <ProjectReference Include="..\..\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
+    </ItemGroup>
 
 </Project>

+ 23 - 23
dotnet/Library/Sers/Sers.Hardware/Sers.Hardware/Sers.Hardware.csproj

@@ -1,34 +1,34 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-硬件信息</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-硬件信息</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.Hardware.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Hardware.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Vit\Vit.Core\Vit.Core\Vit.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Vit\Vit.Core\Vit.Core\Vit.Core.csproj" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<None Update="Sers.Hardware.Net46.Exe.exe">
-			<CopyToOutputDirectory>Never</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
+    <ItemGroup>
+        <None Update="Sers.Hardware.Net46.Exe.exe">
+            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
 
 </Project>

+ 7 - 7
dotnet/Library/Sers/Sers.Hardware/Test/Sers.Hardware.Demo/Sers.Hardware.Demo.csproj

@@ -1,12 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\Sers\Sers.Hardware\Sers.Hardware\Sers.Hardware.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Sers\Sers.Hardware\Sers.Hardware\Sers.Hardware.csproj" />
+    </ItemGroup>
 
 </Project>

+ 34 - 33
dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/Sers.Serslot.csproj

@@ -1,38 +1,39 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
-
-	<PropertyGroup>
-    <TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-Serslot。AspNetCore原生WebApi的接入适配器。
-更新日志:
-    在兼容AspNetCore2.1的同时,兼容 AspNetCore3.0、 AspNetCore3.1、 AspNetCore5.0、AspNetCore6.0。
-    构造Api描述数据时剔除接口参数中指定FromService的参数。
-		</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.Serslot.xml</DocumentationFile>
-		<Copyright />
-	</PropertyGroup>
-
-
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.0" />
-	</ItemGroup>
-
-
-	<ItemGroup>
-		<ProjectReference Include="..\..\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
-	</ItemGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>
+            Sers微服务-Serslot。AspNetCore原生WebApi的接入适配器。
+            更新日志:
+            在兼容AspNetCore2.1的同时,兼容 AspNetCore3.0、 AspNetCore3.1、 AspNetCore5.0、AspNetCore6.0。
+            构造Api描述数据时剔除接口参数中指定FromService的参数。
+        </Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Serslot.xml</DocumentationFile>
+        <Copyright />
+    </PropertyGroup>
+
+
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.0" />
+    </ItemGroup>
+
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
+    </ItemGroup>
 
 
 </Project>

+ 20 - 20
dotnet/Library/Sers/Sers.ServiceStation/Sers.ServiceStation/Sers.ServiceStation.csproj

@@ -1,28 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-服务站点核心库</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-服务站点核心库</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.ServiceStation.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.ServiceStation.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\Sers.CL\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\Sers.CL\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\Sers.CL\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Sers.CL\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\Sers.CL\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\Sers.CL\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+    </ItemGroup>
 
 </Project>

+ 19 - 19
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.MsTest/Vit.Core.MsTest.csproj

@@ -1,28 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<None Remove="appsettings.json" />
-	</ItemGroup>
+    <ItemGroup>
+        <None Remove="appsettings.json" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<Content Include="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+    <ItemGroup>
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
-	<ItemGroup>
-		<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-		<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-		<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\Vit.Core\Vit.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Vit.Core\Vit.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 8 - 11
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Shell.Demo/Vit.Core.Util.Shell.Demo.csproj

@@ -1,15 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\..\Vit.Core\Vit.Core.csproj" />
-  </ItemGroup>
-
- 
-  
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\Vit.Core\Vit.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 1 - 1
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Timer/SersTimer_SingleThread_Test.cs

@@ -13,7 +13,7 @@ namespace Vit.Core.Util.Threading.MsTest.Timer
         {
             int count = 0;
 
-            var timer = new SersTimer_SingleThread();
+            var timer = new VitTimer_SingleThread();
             timer.intervalMs = 100;
 
             string errorMessage = "";

+ 1 - 1
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Timer/SersTimer_Test.cs

@@ -15,7 +15,7 @@ namespace Vit.Core.Util.Threading.MsTest.Timer
         {
             int count = 0;
 
-            var timer = new SersTimer();
+            var timer = new VitTimer();
             timer.intervalMs = 100;
 
 

+ 11 - 11
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Vit.Core.Util.Threading.MsTest.csproj

@@ -1,17 +1,17 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-    <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-    <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
-  </ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\Vit.Core\Vit.Core.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\Vit.Core\Vit.Core.csproj" />
+    </ItemGroup>
 
 </Project>

+ 2 - 2
dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/LogCollector/ElasticSearch/Client/ElasticSearchClient.cs

@@ -78,7 +78,7 @@ namespace Vit.Core.Module.Log.LogCollector.ElasticSearch.Client
         #region Timer
         ConcurrentBag<ElasticSearchRecord> recordList;
         ConcurrentBag<ElasticSearchRecord> recordList_Swap;
-        Util.Threading.Timer.SersTimer_SingleThread time;
+        Util.Threading.Timer.VitTimer_SingleThread time;
 
         private void InitTimer()
         {
@@ -87,7 +87,7 @@ namespace Vit.Core.Module.Log.LogCollector.ElasticSearch.Client
                 StringBuilder buffer = new StringBuilder();
                 recordList = new ConcurrentBag<ElasticSearchRecord>();
                 recordList_Swap = new ConcurrentBag<ElasticSearchRecord>();
-                time = new Util.Threading.Timer.SersTimer_SingleThread();
+                time = new Util.Threading.Timer.VitTimer_SingleThread();
                 time.intervalMs = intervalMs.Value;
                 time.timerCallback = (e) =>
                 {

+ 2 - 2
dotnet/Library/Vit/Vit.Core/Vit.Core/Module/Log/LogCollector/Splunk/Client/SplunkClient.cs

@@ -81,7 +81,7 @@ namespace Vit.Core.Module.Log.LogCollector.Splunk.Client
         #region Timer
         ConcurrentBag<SplunkRecord> recordList;
         ConcurrentBag<SplunkRecord> recordList_Swap;
-        Util.Threading.Timer.SersTimer_SingleThread time;
+        Util.Threading.Timer.VitTimer_SingleThread time;
 
         private void InitTimer()
         {
@@ -89,7 +89,7 @@ namespace Vit.Core.Module.Log.LogCollector.Splunk.Client
             {
                 recordList = new ConcurrentBag<SplunkRecord>();
                 recordList_Swap = new ConcurrentBag<SplunkRecord>();
-                time = new Util.Threading.Timer.SersTimer_SingleThread();
+                time = new Util.Threading.Timer.VitTimer_SingleThread();
                 time.intervalMs = intervalMs.Value;
                 time.timerCallback = (e) =>
                 {

+ 1 - 1
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Common/CommonHelp.cs

@@ -10,7 +10,7 @@ namespace Vit.Core.Util.Common
 {
     public static class CommonHelp
     {
-        /// <summary>            
+        /// <summary>
         /// <para> 构建绝对路径。                                                                                       </para> 
         /// <para> path可为相对路径或绝对路径,若为绝对路径则忽略程序当前路径。                                         </para>
         /// <para> demo: ["Data","Sers","Gover", "Counter.json"],将返回 /root/netapp/xxxx/Data/Sers/Gover/Counter.json  </para>

+ 1 - 1
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Timer/SersTimer.cs → dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Timer/VitTimer.cs

@@ -3,7 +3,7 @@ using System.Threading;
 
 namespace Vit.Core.Util.Threading.Timer
 {
-    public class SersTimer : IDisposable
+    public class VitTimer : IDisposable
     {
         protected System.Threading.Timer _timer = null;
 

+ 7 - 7
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Timer/SersTimer_SingleThead.cs → dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Timer/VitTimer_SingleThead.cs

@@ -6,16 +6,16 @@ namespace Vit.Core.Util.Threading.Timer
     /// <summary>
     /// 若前序timer回调没有执行结束,则后续回调不会被调用
     /// </summary>
-    public class SersTimer_SingleThread : SersTimer
+    public class VitTimer_SingleThread : VitTimer
     {
-        public SersTimer_SingleThread() 
+        public VitTimer_SingleThread()
         {
             _timerCallback = TimerCallback;
         }
 
         protected int locked = 0;
         protected void TimerCallback(object state)
-        {       
+        {
             if (0 != Interlocked.CompareExchange(ref locked, 1, 0))
                 return;
 
@@ -26,20 +26,20 @@ namespace Vit.Core.Util.Threading.Timer
             finally
             {
                 locked = 0;
-            }     
+            }
         }
 
         protected TimerCallback _oriCallback;
         protected readonly TimerCallback _timerCallback;
 
-        public override TimerCallback timerCallback 
+        public override TimerCallback timerCallback
         {
             get => _timerCallback;
-            set 
+            set
             {
                 _oriCallback = value;
             }
-        }       
+        }
 
     }
 }

+ 2 - 2
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Worker/LongThread_TimeLimit.cs

@@ -87,7 +87,7 @@ namespace Vit.Core.Util.Threading.Worker
 
         public LongThread_TimeLimit()
         {
-            pulseMaker = new SersTimer { intervalMs = 300000, timerCallback = PulseMake };
+            pulseMaker = new VitTimer { intervalMs = 300000, timerCallback = PulseMake };
 
             threadCount = 1;
         }
@@ -107,7 +107,7 @@ namespace Vit.Core.Util.Threading.Worker
         /// <summary>
         /// 脉冲生产器
         /// </summary>
-        readonly SersTimer pulseMaker;
+        readonly VitTimer pulseMaker;
 
         /// <summary>
         /// 电子脉冲,在固定的时间间隔发送脉冲

+ 2 - 2
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Threading/Worker/ManagedThread.cs

@@ -61,7 +61,7 @@ namespace Vit.Core.Util.Threading.Worker
 
         public ManagedThread()
         {
-            pulseMaker = new SersTimer { intervalMs = 300000, timerCallback = Pulse };
+            pulseMaker = new VitTimer { intervalMs = 300000, timerCallback = Pulse };
         }
 
 
@@ -80,7 +80,7 @@ namespace Vit.Core.Util.Threading.Worker
         /// <summary>
         /// 脉冲生产器
         /// </summary>
-        readonly SersTimer pulseMaker;
+        readonly VitTimer pulseMaker;
 
         /// <summary>
         /// 电子脉冲,在固定的时间间隔发送脉冲

+ 30 - 30
dotnet/Library/Vit/Vit.Core/Vit.Core/Vit.Core.csproj

@@ -1,39 +1,39 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.17</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.18</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>
-.net core common tool.
-log to txt/console/splunk/ElasticSearch(Vit.Core.Module.Log.Logger),
-Serialize(Vit.Core.Module.Serialization.Json),
-ConfigurationManager(Vit.Core.Util.ConfigurationManager.Appsettings.json),
-DynamicMethodExecutor, Guid, Reflection, Shell etc.
-Send email to serset@yeah.net if you have any questions.
-		</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>
+            .net core common tool.
+            log to txt/console/splunk/ElasticSearch(Vit.Core.Module.Log.Logger),
+            Serialize(Vit.Core.Module.Serialization.Json),
+            ConfigurationManager(Vit.Core.Util.ConfigurationManager.Appsettings.json),
+            DynamicMethodExecutor, Guid, Reflection, Shell etc.
+            Send email to serset@yeah.net if you have any questions.
+        </Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<!--<LangVersion>latest</LangVersion>-->
-		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-		<DocumentationFile>bin\Debug\netstandard2.0\Vit.Core.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <!--<LangVersion>latest</LangVersion>-->
+        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+        <DocumentationFile>bin\Debug\netstandard2.0\Vit.Core.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<PackageReference Include="System.Buffers" Version="4.5.1" />
-		<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
-		<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
-		<PackageReference Include="System.Memory" Version="4.5.4" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="System.Buffers" Version="4.5.1" />
+        <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
+        <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
+        <PackageReference Include="System.Memory" Version="4.5.4" />
+    </ItemGroup>
 
 </Project>

+ 22 - 23
dotnet/Library/Vit/Vit.Net.Http.FormFile/Vit.Net.Http.FormFile.csproj

@@ -1,32 +1,31 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.17</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.18</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>对Http.FormFile MultipartForm的处理</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>对Http.FormFile MultipartForm的处理</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Vit.Net.Http.FormFile.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Vit.Net.Http.FormFile.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.0" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.0" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\Vit.Core\Vit.Core\Vit.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\Vit.Core\Vit.Core\Vit.Core.csproj" />
+    </ItemGroup>
 
-
-</Project>
+</Project>

+ 28 - 28
dotnet/Library/Vit/Vit.WebHost/Vit.WebHost.csproj

@@ -1,33 +1,33 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.17</Version>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>对NetCore Host的扩展</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Vit.WebHost.xml</DocumentationFile>
-	</PropertyGroup>
-
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.1.0" />
-		<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.0" />
-		<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<ProjectReference Include="..\Vit.Core\Vit.Core\Vit.Core.csproj" />
-	</ItemGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.18</Version>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>对NetCore Host的扩展</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Vit.WebHost.xml</DocumentationFile>
+    </PropertyGroup>
+
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.1.0" />
+        <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.0" />
+        <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\Vit.Core\Vit.Core\Vit.Core.csproj" />
+    </ItemGroup>
 
 
 </Project>

+ 11 - 0
dotnet/Sers.sln

@@ -155,6 +155,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sers.ApiTrace.Collector.Zip
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vit.Core.Util.Threading.MsTest", "Library\Vit\Vit.Core\Test\Vit.Core.Util.Threading.MsTest\Vit.Core.Util.Threading.MsTest.csproj", "{6A154DEE-D6EB-4DD5-B1EC-CF23ED89D743}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken", "Library\Sers\Sers.Core\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj", "{39A9BA34-1369-40C6-BABF-FEC57787165B}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -523,6 +525,14 @@ Global
 		{6A154DEE-D6EB-4DD5-B1EC-CF23ED89D743}.Release|Any CPU.Build.0 = Release|Any CPU
 		{6A154DEE-D6EB-4DD5-B1EC-CF23ED89D743}.Release|x86.ActiveCfg = Release|Any CPU
 		{6A154DEE-D6EB-4DD5-B1EC-CF23ED89D743}.Release|x86.Build.0 = Release|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Debug|x86.Build.0 = Debug|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Release|x86.ActiveCfg = Release|Any CPU
+		{39A9BA34-1369-40C6-BABF-FEC57787165B}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -600,6 +610,7 @@ Global
 		{E230747C-FA8C-4BAB-801E-3AA7A07FD9D0} = {B0C8734C-7CAC-4EA4-BF49-4ECE4876BB5D}
 		{B464178B-2397-4E83-9320-CFB5A6485378} = {97C34C06-AE79-4E1A-8D04-EB0107643302}
 		{6A154DEE-D6EB-4DD5-B1EC-CF23ED89D743} = {B0C8734C-7CAC-4EA4-BF49-4ECE4876BB5D}
+		{39A9BA34-1369-40C6-BABF-FEC57787165B} = {C3954FC1-88A0-4915-AF47-E0B75AAAA63A}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {C7DA16E3-9949-49FA-B0B4-F830636DE60F}

+ 45 - 44
dotnet/ServiceCenter/App.Gover.Gateway/App.Gover.Gateway.csproj

@@ -1,46 +1,47 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-	<PropertyGroup>
-		<publish>Gover</publish>
-		<docker>sers-gover</docker>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-
-	<ItemGroup>
-		<Compile Include="..\..\Gateway\App.Gateway\Program.cs" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<Content Include="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-		<Content Include="contentTypeMap.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
-
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore.App" />
-
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.Gateway\Sers.Gateway\Sers.Gateway.csproj" />
-	</ItemGroup>
-
-	<ItemGroup>
-		<Content Include="wwwroot\**">
-			<Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+<Project Sdk="Microsoft.NET.Sdk">
+
+    <PropertyGroup>
+        <publish>Gover</publish>
+        <docker>sers-gover</docker>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+        <Version>2.1.21</Version>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+
+    <ItemGroup>
+        <Compile Include="..\..\Gateway\App.Gateway\Program.cs" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+        <Content Include="contentTypeMap.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.App" />
+
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.Core\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.Gateway\Sers.Gateway\Sers.Gateway.csproj" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <Content Include="wwwroot\**">
+            <Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
 </Project>

+ 14 - 0
dotnet/ServiceCenter/App.Gover.Gateway/appsettings.json

@@ -156,6 +156,20 @@
           "api_httpMethod": "POST"
         },
 
+        {
+          /* 在此Assembly中加载类 */
+          "assemblyFile": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.dll",
+          /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
+          //"className": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.JsonWebToken",
+          //在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的Authorization, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+
+          // if token is valid, will set rpcData.caller.source to CallerSource
+          "CallerSource": "Internal",
+          //"issuer": "https://sso.lith.cloud:4",
+          //"audiences": [ "http://localhost:4580" ],
+          "publicKeysDiscovery_Url": "https://sso.lith.cloud:4/oauth2/v1/discovery/keys"
+        },
+
         {
           //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
           "className": "AccountInCookie",

+ 6 - 2
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ActiveApiDoc.html

@@ -9,11 +9,15 @@
 
     <script src="Scripts/jquery/jquery.min.js"></script>
 
+    <!-- Vit.SSO -->
+    <script src="Scripts/Vit.SSO/AuthService.Env.js"></script>
+    <script src="Scripts/Vit.SSO/AuthService.js" makeSureLogin="true"></script>
+
     <!-- Main CSS -->
-    <link rel="stylesheet" href="Scripts/blog/css/style.css">
+    <link rel="stylesheet" href="Scripts/blog/css/style.css" />
 
     <!-- Font Awesome -->
-    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet">
+    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet" />
 </head>
 
 <body>

+ 6 - 2
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ApiDoc.html

@@ -9,11 +9,15 @@
 
     <script src="Scripts/jquery/jquery.min.js"></script>
 
+    <!-- Vit.SSO -->
+    <script src="Scripts/Vit.SSO/AuthService.Env.js"></script>
+    <script src="Scripts/Vit.SSO/AuthService.js" makeSureLogin="true"></script>
+
     <!-- Main CSS -->
-    <link rel="stylesheet" href="Scripts/blog/css/style.css">
+    <link rel="stylesheet" href="Scripts/blog/css/style.css" />
 
     <!-- Font Awesome -->
-    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet">
+    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet" />
 </head>
 
 <body>

+ 6 - 2
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ApiStation.html

@@ -9,11 +9,15 @@
 
     <script src="Scripts/jquery/jquery.min.js"></script>
 
+    <!-- Vit.SSO -->
+    <script src="Scripts/Vit.SSO/AuthService.Env.js"></script>
+    <script src="Scripts/Vit.SSO/AuthService.js" makeSureLogin="true"></script>
+
     <!-- Main CSS -->
-    <link rel="stylesheet" href="Scripts/blog/css/style.css">
+    <link rel="stylesheet" href="Scripts/blog/css/style.css" />
 
     <!-- Font Awesome -->
-    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet">
+    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet" />
 </head>
 
 <body>

+ 6 - 3
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Health.html

@@ -6,14 +6,17 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 
-
     <script src="Scripts/jquery/jquery.min.js"></script>
 
+    <!-- Vit.SSO -->
+    <script src="Scripts/Vit.SSO/AuthService.Env.js"></script>
+    <script src="Scripts/Vit.SSO/AuthService.js" makeSureLogin="true"></script>
+
     <!-- Main CSS -->
-    <link rel="stylesheet" href="Scripts/blog/css/style.css">
+    <link rel="stylesheet" href="Scripts/blog/css/style.css" />
 
     <!-- Font Awesome -->
-    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet">
+    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet" />
 </head>
 
 <body>

+ 6 - 2
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/RateLimit.html

@@ -9,11 +9,15 @@
 
     <script src="Scripts/jquery/jquery.min.js"></script>
 
+    <!-- Vit.SSO -->
+    <script src="Scripts/Vit.SSO/AuthService.Env.js"></script>
+    <script src="Scripts/Vit.SSO/AuthService.js" makeSureLogin="true"></script>
+
     <!-- Main CSS -->
-    <link rel="stylesheet" href="Scripts/blog/css/style.css">
+    <link rel="stylesheet" href="Scripts/blog/css/style.css" />
 
     <!-- Font Awesome -->
-    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet">
+    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet" />
 </head>
 
 <body>

+ 15 - 0
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/AuthService.Env.js

@@ -0,0 +1,15 @@
+let AuthService_Config = {
+    autoLogin: false,
+    onLoginSuccess: (accessToken) => {
+        // {access_token:'xx',expires_time:'1686857267655'}
+
+        //set token to cookie
+        let expires = new Date(parseInt(accessToken.expires_time));
+        document.cookie = "Authorization=" + escape(accessToken.access_token) + ";path=/;expires=" + expires.toGMTString();
+    },
+    //audience: "http://localhost:4580",
+    loginUrl: '/_gover_/Scripts/Vit.SSO/login.html',
+    //indexUrl: '/',
+    ssoBaseUrl: 'https://sso.lith.cloud:4'
+};
+

+ 175 - 0
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/AuthService.js

@@ -0,0 +1,175 @@
+/* ========================================================================
+ * Author  : Lith
+ * Version : 1.3
+ * Date    : 2023-06-18
+ * Email   : serset@yeah.net
+ * ======================================================================== */
+
+/* AuthService.js
+
+    <script src="./AuthService.js" makeSureLogin="true"></script>
+
+    <script type="text/javascript" >
+       let token = authService.accessToken.access_token;
+
+       authService.logoff();
+       authService.makeSureLogin();
+    </script>
+ */
+
+; ((window) => {
+
+    window.authStore = new AuthStore();
+    window.authService = new AuthService();
+
+
+    function AuthStore() {
+
+        // getQueryString('name')    getQueryString("aaa.html?a=1&amp;b=2",'name')
+        this.getQueryString = function (key, src) {
+            if (!src) src = location.search;
+            var v = (src.match(new RegExp("(?:\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
+            return v && decodeURIComponent(v);
+        };
+
+        this.clearToken = function () {
+            localStorage.removeItem('jwt_token');
+            localStorage.removeItem('jwt_token_expires_time');
+        };
+
+        this.cacheToken = function (accessToken) {
+            localStorage.setItem('jwt_token', accessToken.access_token);
+            let expires_time = parseInt(accessToken.expires_time);
+            if (!expires_time && accessToken.expires_in) {
+                let expires_in = accessToken.expires_in - 10;
+                expires_time = accessToken.expires_time = new Date().getTime() + expires_in * 1000;
+            }
+            if (!expires_time || expires_time <= new Date().getTime()) {
+                return null;
+            }
+            localStorage.setItem('jwt_token_expires_time', expires_time);
+
+            return {
+                access_token: localStorage.getItem('jwt_token'),
+                expires_time: localStorage.getItem('jwt_token_expires_time')
+            };
+        };
+
+        //{access_token:'xx',expires_time:'1686857267655'}
+        this.getToken = function () {
+            var expires_time = parseInt(localStorage.getItem('jwt_token_expires_time'));
+            if (expires_time) {
+                if (expires_time <= new Date().getTime()) {
+                    localStorage.removeItem('jwt_token');
+                    localStorage.removeItem('jwt_token_expires_time');
+                }
+                else {
+                    return {
+                        access_token: localStorage.getItem('jwt_token'),
+                        expires_time: localStorage.getItem('jwt_token_expires_time')
+                    };
+                }
+            }
+            return null;
+        };
+    }
+
+
+
+    function AuthService() {
+        this.audience;
+        this.loginUrl = '/login.html';
+        this.indexUrl = '/';
+        this.ssoBaseUrl = 'https://sso.lith.cloud';
+        this.onLoginSuccess = null;
+
+        this.accessToken = null;
+        let self = this;
+        function jumpToSsoLogin() {
+            //'https://sso.vit.com.cn/connect/authorize?client_id=Vit.SSO.Example&redirect_uri=http://localhost:5000&response_type=token&scope=openid profile email phone&state=123&nonce=456&audience=common';
+            let url = self.ssoBaseUrl + '/login.html?redirect_uri=' + encodeURIComponent(location.href);
+            if (self.audience) url += '&audience=' + encodeURIComponent(self.audience);
+            window.location.href = url;
+        }
+
+
+        function jumpToPrevUrl() {
+            let redirect_uri = localStorage.getItem('jwt_redirect_uri');
+            if (redirect_uri) {
+                localStorage.removeItem('jwt_redirect_uri');
+                window.location.href = redirect_uri;
+            } else {
+                window.location.href = self.indexUrl;
+            }
+        };
+
+
+        //  authClient.login();
+        this.login = function () {
+
+            let access_token = authStore.getQueryString('access_token');
+            if (access_token) {
+                var expires_time = authStore.getQueryString('expires_time');
+                this.accessToken = authStore.cacheToken({ access_token, expires_time });
+                if (this.accessToken) {
+                    try {
+                        if (this.onLoginSuccess) this.onLoginSuccess(this.accessToken);
+                    } catch (e) {
+                        console.log(e);
+                    }
+                    jumpToPrevUrl();
+                    return this.accessToken;
+                }
+            }
+            this.accessToken = authStore.getToken();
+            if (this.accessToken) {
+                jumpToPrevUrl();
+                return this.accessToken;
+            }
+            jumpToSsoLogin();
+            return false;
+        };
+
+        this.logoff = function (redirect_uri) {
+            this.accessToken = null;
+            authStore.clearToken();
+            if (!redirect_uri) redirect_uri = new URL(this.indexUrl, location.origin).toString();
+            window.location.href = self.ssoBaseUrl + '/logoff.html?redirect_uri=' + encodeURIComponent(redirect_uri);
+        };
+
+
+
+
+        //  authService.makeSureLogin();
+        this.makeSureLogin = function () {
+            this.accessToken = authStore.getToken();
+            if (this.accessToken) {
+                return this.accessToken;
+            }
+            localStorage.setItem('jwt_redirect_uri', location.href);
+            window.location.href = this.loginUrl;
+            return false;
+        };
+
+    }
+
+    try {
+        let config = (typeof (AuthService_Config) == 'object') ? AuthService_Config : {};
+
+        if (config.loginUrl) authService.loginUrl = config.loginUrl;
+        if (config.indexUrl) authService.indexUrl = config.indexUrl;
+        if (config.onLoginSuccess) authService.onLoginSuccess = config.onLoginSuccess;
+        if (config.ssoBaseUrl) authService.ssoBaseUrl = config.ssoBaseUrl;
+        if (config.audience) authService.audience = config.audience;
+
+        if ('true' == document.currentScript.getAttribute('makeSureLogin')) {
+            if (config.autoLogin !== false)
+                authService.makeSureLogin();
+        } else if ('true' == document.currentScript.getAttribute('login')) {
+            authService.login();
+        }
+    } catch (e) {
+        console.log(e);
+    }
+
+})(window);

+ 12 - 0
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/login.html

@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>Login</title>
+    <script src="AuthService.Env.js"></script>
+    <script src="AuthService.js" login="true"></script>
+</head>
+<body>
+</body>
+</html>

+ 15 - 0
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/Scripts/Vit.SSO/logoff.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>Logoff</title>
+    <script src="AuthService.Env.js"></script>
+    <script src="AuthService.js"></script>
+    <script type="text/javascript">
+        authService.logoff();
+    </script>
+</head>
+<body>
+</body>
+</html>

+ 7 - 4
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/ServiceStation.html

@@ -9,11 +9,15 @@
 
     <script src="Scripts/jquery/jquery.min.js"></script>
 
+    <!-- Vit.SSO -->
+    <script src="Scripts/Vit.SSO/AuthService.Env.js"></script>
+    <script src="Scripts/Vit.SSO/AuthService.js" makeSureLogin="true"></script>
+
     <!-- Main CSS -->
-    <link rel="stylesheet" href="Scripts/blog/css/style.css">
+    <link rel="stylesheet" href="Scripts/blog/css/style.css" />
 
     <!-- Font Awesome -->
-    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet">
+    <link href="Scripts/blog/css/font-awesome.min.css" rel="stylesheet" />
 </head>
 
 <body>
@@ -101,11 +105,10 @@
     <!-- Jumbtron / Slider -->
     <!--<div class="jumbotron-wrap">
         <div class="container">
-            <div class="jumbotron jumbotron-narrow static-slider"> 
+            <div class="jumbotron jumbotron-narrow static-slider">
             </div>
         </div>
     </div>-->
-
     <!-- Main content area -->
     <main class="container">
         <div class="row">

+ 2 - 0
dotnet/ServiceCenter/App.Gover.Gateway/wwwroot/_gover_/index.html

@@ -137,6 +137,8 @@
                         <h4>login</h4>
                         <ul>
                             <li><a href="index.html">login</a></li>
+                            <li><a href="Scripts/Vit.SSO/login.html">Vit.SSO login</a></li>
+                            <li><a href="Scripts/Vit.SSO/logoff.html">Vit.SSO logoff</a></li>
                         </ul>
                     </div>
 

+ 41 - 40
dotnet/ServiceCenter/App.ServiceCenter/App.ServiceCenter.csproj

@@ -1,45 +1,46 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<publish>ServiceCenter</publish>
-		<docker>sers</docker>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-
-	<ItemGroup>
-		<Content Include="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-
-		<Content Include="contentTypeMap.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
-
-	<ItemGroup>
-		<PackageReference Include="Microsoft.AspNetCore.App" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\Library\Sers\Sers.Gateway\Sers.Gateway\Sers.Gateway.csproj" />
-		<ProjectReference Include="..\Sers.ServiceCenter\Sers.Gover\Sers.Gover.csproj" />
-	</ItemGroup>
-
-
-	<ItemGroup>
-		<Content Include="..\App.Gover.Gateway\wwwroot\**">
-			<Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+    <PropertyGroup>
+        <publish>ServiceCenter</publish>
+        <docker>sers</docker>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+        <Version>2.1.21</Version>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+
+    <ItemGroup>
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+
+        <Content Include="contentTypeMap.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.App" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.Core\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken\Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj" />
+        <ProjectReference Include="..\..\Library\Sers\Sers.Gateway\Sers.Gateway\Sers.Gateway.csproj" />
+        <ProjectReference Include="..\Sers.ServiceCenter\Sers.Gover\Sers.Gover.csproj" />
+    </ItemGroup>
+
+
+    <ItemGroup>
+        <Content Include="..\App.Gover.Gateway\wwwroot\**">
+            <Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
 
 </Project>

+ 4 - 2
dotnet/ServiceCenter/App.ServiceCenter/Program.cs

@@ -1,5 +1,7 @@
 using Newtonsoft.Json.Linq;
+
 using Sers.Gateway;
+
 using Vit.Core.Module.Log;
 using Vit.Core.Util.ConfigurationManager;
 using Vit.Extensions;
@@ -18,7 +20,7 @@ namespace App.ServiceCenter
             #region (x.2) 初始化扩展模块
 
             #region (x.x.1)使用 Gover 服务治理 模块
-            Sers.ServiceCenter.ServiceCenter.Instance.UseGover();             
+            Sers.ServiceCenter.ServiceCenter.Instance.UseGover();
             #endregion
 
 
@@ -27,7 +29,7 @@ namespace App.ServiceCenter
             if (BeforeCallApi != null) Sers.ServiceCenter.ServiceCenter.Instance.apiCenterService.BeforeCallApi += BeforeCallApi;
             #endregion
 
-            //(x.x.3)从配置文件(appsettings.json::Sers.LocalApiService.ApiLoaders ) 加载api加载器并加载api        
+            //(x.x.3)从配置文件(appsettings.json::Sers.LocalApiService.ApiLoaders ) 加载api加载器并加载api
             Sers.ServiceCenter.ServiceCenter.Instance.LoadApi();
 
             //(x.x.4)加载系统Api

+ 42 - 0
dotnet/ServiceCenter/App.ServiceCenter/appsettings.json

@@ -308,6 +308,20 @@
           "api_httpMethod": "POST"
         },
 
+        {
+          /* 在此Assembly中加载类 */
+          "assemblyFile": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.dll",
+          /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
+          //"className": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.JsonWebToken",
+          //在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的Authorization, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+
+          // if token is valid, will set rpcData.caller.source to CallerSource
+          "CallerSource": "Internal",
+          //"issuer": "https://sso.lith.cloud:4",
+          //"audiences": [ "http://localhost:4580" ],
+          "publicKeysDiscovery_Url": "https://sso.lith.cloud:4/oauth2/v1/discovery/keys"
+        },
+
         {
           //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
           "className": "AccountInCookie",
@@ -379,6 +393,20 @@
           "api_httpMethod": "POST"
         },
 
+        {
+          /* 在此Assembly中加载类 */
+          "assemblyFile": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.dll",
+          /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
+          //"className": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.JsonWebToken",
+          //在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的Authorization, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+
+          // if token is valid, will set rpcData.caller.source to CallerSource
+          "CallerSource": "Internal",
+          //"issuer": "https://sso.lith.cloud:4",
+          //"audiences": [ "http://localhost:4580" ],
+          "publicKeysDiscovery_Url": "https://sso.lith.cloud:4/oauth2/v1/discovery/keys"
+        },
+
         {
           //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
           //"className": "AccountInCookie",
@@ -672,6 +700,20 @@
           "api_httpMethod": "POST"
         },
 
+        {
+          /* 在此Assembly中加载类 */
+          "assemblyFile": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.dll",
+          /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
+          //"className": "Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.JsonWebToken",
+          //在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),或cookie中的Authorization, 并把jwt中的Claims信息放到 rpcData.user.userInfo
+
+          // if token is valid, will set rpcData.caller.source to CallerSource
+          "CallerSource": "Internal",
+          //"issuer": "https://sso.lith.cloud:4",
+          //"audiences": [ "http://localhost:4580" ],
+          "publicKeysDiscovery_Url": "https://sso.lith.cloud:4/oauth2/v1/discovery/keys"
+        },
+
         {
           //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
           "className": "AccountInCookie",

+ 18 - 18
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ApiTrace.Collector.Zipkin/Sers.ApiTrace.Collector.Zipkin.csproj

@@ -1,27 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.19-temp</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.19-temp</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-Zipkin收集器,推送Api Trace到Zipkin</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-Zipkin收集器,推送Api Trace到Zipkin</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.ApiTrace.Collector.Zipkin.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.ApiTrace.Collector.Zipkin.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<PackageReference Include="zipkin4net" Version="1.5.0" />
-	</ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="zipkin4net" Version="1.5.0" />
+    </ItemGroup>
 
-	<ItemGroup>
-	  <ProjectReference Include="..\..\..\Library\Sers\Sers.Core\Sers.Core\Sers.Core.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Library\Sers\Sers.Core\Sers.Core\Sers.Core.csproj" />
+    </ItemGroup>
 
 
 </Project>

+ 2 - 2
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Extensions/ServiceCenter_GoverExtensions.cs

@@ -81,14 +81,14 @@ namespace Vit.Extensions
 
         }
 
-        static SersTimer timer = null;
+        static VitTimer timer = null;
 
 
         [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
         static void QpsTimer_Start()
         {
             if (null != timer) return;
-            timer = new SersTimer
+            timer = new VitTimer
             {
                 intervalMs = 2000,
                 timerCallback =

+ 18 - 18
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.Gover/Sers.Gover.csproj

@@ -1,27 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-服务中心,服务治理库</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-服务中心,服务治理库</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.Gover.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Gover.xml</DocumentationFile>
+    </PropertyGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\Sers.ServiceCenter\Sers.ServiceCenter.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\Sers.ServiceCenter\Sers.ServiceCenter.csproj" />
+    </ItemGroup>
 
 
 </Project>

+ 2 - 4
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter/Controllers/ServiceStationController.cs

@@ -7,9 +7,7 @@ using Vit.Core.Util.ComponentModel.Api;
 using Vit.Core.Util.ComponentModel.Data;
 using Vit.Core.Util.ComponentModel.Model;
 using Vit.Extensions;
-using System.Net.WebSockets;
 using System.Net;
-using System;
 
 namespace Sers.ServiceCenter.Controllers
 {
@@ -80,8 +78,8 @@ namespace Sers.ServiceCenter.Controllers
         [SsCallerSource(ECallerSource.Internal)]
         public ApiReturn UpdateStationInfo(ServiceStation serviceStation)
         {
-            serviceStation.connection = CommunicationManageServer.CurConn;          
-            return ServiceCenter.Instance.apiCenterService.ServiceStation_UpdateStationInfo(serviceStation); 
+            serviceStation.connection = CommunicationManageServer.CurConn;
+            return ServiceCenter.Instance.apiCenterService.ServiceStation_UpdateStationInfo(serviceStation);
         }
 
 

+ 28 - 28
dotnet/ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter/Sers.ServiceCenter.csproj

@@ -1,31 +1,31 @@
 <Project Sdk="Microsoft.NET.Sdk">
-	
-	<PropertyGroup>
-		<pack>nuget</pack>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<TargetFramework>netstandard2.0</TargetFramework>
-		<Version>2.1.21-preview19</Version>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<Authors>Lith</Authors>
-		<Description>Sers微服务-服务中心</Description>
-		<PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
-	</PropertyGroup>
-
-
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\netstandard2.0\Sers.ServiceCenter.xml</DocumentationFile>
-	</PropertyGroup>
-
-
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
-		<ProjectReference Include="..\..\..\Library\Sers\Sers.CL\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
-		<ProjectReference Include="..\..\..\Library\Sers\Sers.CL\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
-		<ProjectReference Include="..\Sers.ApiTrace.Collector.Zipkin\Sers.ApiTrace.Collector.Zipkin.csproj" />
-	</ItemGroup>
+
+    <PropertyGroup>
+        <pack>nuget</pack>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <TargetFramework>netstandard2.0</TargetFramework>
+        <Version>2.1.21</Version>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <Authors>Lith</Authors>
+        <Description>Sers微服务-服务中心</Description>
+        <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
+    </PropertyGroup>
+
+
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\netstandard2.0\Sers.ServiceCenter.xml</DocumentationFile>
+    </PropertyGroup>
+
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.NamedPipe\Sers.CL.Ipc.NamedPipe.csproj" />
+        <ProjectReference Include="..\..\..\Library\Sers\Sers.CL\Socket\Sers.CL.Socket.Iocp\Sers.CL.Socket.Iocp.csproj" />
+        <ProjectReference Include="..\..\..\Library\Sers\Sers.CL\Socket\Sers.CL.Socket.ThreadWait\Sers.CL.Socket.ThreadWait.csproj" />
+        <ProjectReference Include="..\Sers.ApiTrace.Collector.Zipkin\Sers.ApiTrace.Collector.Zipkin.csproj" />
+    </ItemGroup>
 
 </Project>

+ 41 - 41
dotnet/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo/Did.SersLoader.Demo.csproj

@@ -1,45 +1,45 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<publish>Demo</publish>
-		<docker>sers-demo</docker>
-	</PropertyGroup>
-
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net6.0</TargetFramework>
-    <Version>2.1.21-preview19</Version>
-    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
-    <Description>https://github.com/serset/Sers</Description>
-  </PropertyGroup>
-
-  <PropertyGroup>
-    <DocumentationFile>bin\Debug\net6.0\Did.SersLoader.Demo.xml</DocumentationFile>   
-  </PropertyGroup>
- 
-  
-  <ItemGroup>
-
-    <None Update="wwwroot\**">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    
-    <None Update="contentTypeMap.json">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </None>
-  
-    <Content Include="appsettings.json">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
-  
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
-    <ProjectReference Include="..\..\..\..\Library\Vit\Vit.Net.Http.FormFile\Vit.Net.Http.FormFile.csproj" />
-  </ItemGroup> 
+    <PropertyGroup>
+        <publish>Demo</publish>
+        <docker>sers-demo</docker>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+        <Version>2.1.21</Version>
+        <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
+        <Description>https://github.com/serset/Sers</Description>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\net6.0\Did.SersLoader.Demo.xml</DocumentationFile>
+    </PropertyGroup>
+
+
+    <ItemGroup>
+
+        <None Update="wwwroot\**">
+            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+        </None>
+
+        <None Update="contentTypeMap.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Vit\Vit.Net.Http.FormFile\Vit.Net.Http.FormFile.csproj" />
+    </ItemGroup>
 
 </Project>

+ 10 - 10
dotnet/ServiceStation/Demo/SersLoader/Did.SersLoader.HelloWorld/Did.SersLoader.HelloWorld.csproj

@@ -1,17 +1,17 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\net6.0\Did.SersLoader.HelloWorld.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\net6.0\Did.SersLoader.HelloWorld.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
+    </ItemGroup>
 
 </Project>

+ 21 - 21
dotnet/ServiceStation/Demo/Serslot/Did.Serslot.Demo/Did.Serslot.Demo.csproj

@@ -1,31 +1,31 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-  <PropertyGroup>
-    <DocumentationFile>bin\Debug\net6.0\Did.Serslot.Demo.xml</DocumentationFile>
-  </PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\net6.0\Did.Serslot.Demo.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-  <ItemGroup>
-    <Folder Include="wwwroot\" />
-  </ItemGroup>
+    <ItemGroup>
+        <Folder Include="wwwroot\" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.App" />
-  </ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.App" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.Serslot\Sers.Serslot\Sers.Serslot.csproj" />
-  </ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.Serslot\Sers.Serslot\Sers.Serslot.csproj" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <Content Update="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
-  <ItemGroup>
-    <Content Update="appsettings.json">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
 
-  
 </Project>

+ 22 - 22
dotnet/ServiceStation/Demo/Serslot/Did.Serslot.HelloWorld/Did.Serslot.HelloWorld.csproj

@@ -1,32 +1,32 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
-  </PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-  <PropertyGroup>
-    <DocumentationFile>bin\Debug\net6.0\Did.Serslot.HelloWorld.xml</DocumentationFile>
-  </PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\net6.0\Did.Serslot.HelloWorld.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-  <ItemGroup>
-    <Folder Include="wwwroot\" />
-  </ItemGroup>
+    <ItemGroup>
+        <Folder Include="wwwroot\" />
+    </ItemGroup>
 
-  <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.App" />
-  </ItemGroup>
+    <ItemGroup>
+        <PackageReference Include="Microsoft.AspNetCore.App" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.Serslot\Sers.Serslot\Sers.Serslot.csproj" />
+    </ItemGroup>
+
+    <ItemGroup>
+        <Content Update="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\Library\Sers\Sers.Serslot\Sers.Serslot\Sers.Serslot.csproj" />
-  </ItemGroup>
 
-  <ItemGroup>
-    <Content Update="appsettings.json">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
 
- 
-  
 </Project>

+ 17 - 17
dotnet/ServiceStation/Demo/Serslot/Did.Serslot.HelloWorld60/Did.Serslot.HelloWorld60.csproj

@@ -1,27 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
-	<PropertyGroup>
-		<TargetFramework>net6.0</TargetFramework>
-	</PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>net6.0</TargetFramework>
+    </PropertyGroup>
 
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\net6.0\Did.Serslot.HelloWorld60.xml</DocumentationFile>
-	</PropertyGroup>
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\net6.0\Did.Serslot.HelloWorld60.xml</DocumentationFile>
+    </PropertyGroup>
 
 
-	<ItemGroup>
-		<Folder Include="wwwroot\" />
-	</ItemGroup>
+    <ItemGroup>
+        <Folder Include="wwwroot\" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.Serslot\Sers.Serslot\Sers.Serslot.csproj" />
-	</ItemGroup>
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.Serslot\Sers.Serslot\Sers.Serslot.csproj" />
+    </ItemGroup>
 
-	<ItemGroup>
-		<Content Update="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
+    <ItemGroup>
+        <Content Update="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
 
 
 

+ 43 - 43
dotnet/ServiceStation/Demo/StressTest/App.Robot.Station/App.Robot.Station.csproj

@@ -1,47 +1,47 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
-	<PropertyGroup>
-		<publish>Robot</publish>
-		<docker>sers-demo-robot</docker>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<OutputType>Exe</OutputType>
-		<TargetFramework>net6.0</TargetFramework>
-		<RunPostBuildEvent>Always</RunPostBuildEvent>
-		<Version>2.1.21-preview19</Version>
-		<Description>https://github.com/serset/Sers</Description>
-	</PropertyGroup>
-
-	<PropertyGroup>
-		<DocumentationFile>bin\Debug\net6.0\App.Robot.Station.xml</DocumentationFile>
-	</PropertyGroup>
-
-	<ItemGroup>
-		<Content Include="appsettings.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
-
-	<ItemGroup>
-		<None Update="Data\App.Robot.json">
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</None>
-	</ItemGroup>
-
-	<ItemGroup>
-		<Content Include="wwwroot\**">
-			<Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
-			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
-		</Content>
-	</ItemGroup>
-
-	<ItemGroup>
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
-		<ProjectReference Include="..\..\..\..\Library\Sers\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
-	</ItemGroup>
+    <PropertyGroup>
+        <publish>Robot</publish>
+        <docker>sers-demo-robot</docker>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <OutputType>Exe</OutputType>
+        <TargetFramework>net6.0</TargetFramework>
+        <RunPostBuildEvent>Always</RunPostBuildEvent>
+        <Version>2.1.21</Version>
+        <Description>https://github.com/serset/Sers</Description>
+    </PropertyGroup>
+
+    <PropertyGroup>
+        <DocumentationFile>bin\Debug\net6.0\App.Robot.Station.xml</DocumentationFile>
+    </PropertyGroup>
+
+    <ItemGroup>
+        <Content Include="appsettings.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+    <ItemGroup>
+        <None Update="Data\App.Robot.json">
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </None>
+    </ItemGroup>
+
+    <ItemGroup>
+        <Content Include="wwwroot\**">
+            <Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
+            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+        </Content>
+    </ItemGroup>
+
+    <ItemGroup>
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.CL\Zmq\ThreadWait\Sers.CL.ClrZmq.ThreadWait\Sers.CL.ClrZmq.ThreadWait.csproj" />
+        <ProjectReference Include="..\..\..\..\Library\Sers\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />
+    </ItemGroup>
 
 </Project>