NewLife/NewLife.Remoting

ClientBase延迟默认SetActions,便于StarClient启动前关闭部分Features
智能大石头 authored at 2025-04-17 00:49:30
6bf0a04
Tree
1 Parent(s) 6d1875c
Summary: 1 changed files with 2 additions and 2 deletions.
Modified +2 -2
Modified +2 -2
diff --git a/NewLife.Remoting/Clients/ClientBase.cs b/NewLife.Remoting/Clients/ClientBase.cs
index 7e17bf9..bb85e2b 100644
--- a/NewLife.Remoting/Clients/ClientBase.cs
+++ b/NewLife.Remoting/Clients/ClientBase.cs
@@ -126,8 +126,6 @@ public abstract class ClientBase : DisposeBase, IApiClient, ICommandClient, IEve
     public ClientBase()
     {
         Name = GetType().Name.TrimEnd("Client");
-
-        SetActions("Device/");
     }
 
     /// <summary>通过客户端设置实例化</summary>
@@ -185,6 +183,8 @@ public abstract class ClientBase : DisposeBase, IApiClient, ICommandClient, IEve
         if (_client != null) return;
 
         OnInit();
+
+        if (Actions == null || Actions.Count == 0) SetActions("Device/");
     }
 
     /// <summary>初始化对象容器以及客户端</summary>