Browse Source

REPORT-130867 远程环境A切换到远程环境B,设计器目录树没有刷新

fbp-1.0
Destiny.Lin 3 months ago
parent
commit
18bd4dd91e
  1. 7
      designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java

7
designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java vendored

@ -1,7 +1,9 @@
package com.fr.design.env; package com.fr.design.env;
import com.fanruan.workplace.http.HttpConstants; import com.fanruan.workplace.http.HttpConstants;
import com.fanruan.workplace.http.HttpServiceMap;
import com.fanruan.workplace.http.RepositoryManager; import com.fanruan.workplace.http.RepositoryManager;
import com.fanruan.workplace.http.info.Stub;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
@ -15,6 +17,7 @@ import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.connect.WorkspaceConnector; import com.fr.workspace.connect.WorkspaceConnector;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
/** /**
@ -52,6 +55,10 @@ public class HttpWorkspaceConnector implements WorkspaceConnector {
public WorkspaceClient connect(WorkspaceConnectionInfo connectionInfo) throws Exception { public WorkspaceClient connect(WorkspaceConnectionInfo connectionInfo) throws Exception {
FineWorkspaceHttpClient client = FineWorkspaceHttpClient.create("Http-Client", connectionInfo); FineWorkspaceHttpClient client = FineWorkspaceHttpClient.create("Http-Client", connectionInfo);
try { try {
for (Map.Entry<Class, Stub<?>> entry : HttpServiceMap.getInstance().entrySet()) {
Stub<?> stub = entry.getValue();
stub.clearProxy();
}
LoginResponseInfoBean bean = RemoteAuthorityRepository.getInstance().login(createLoginBean(connectionInfo)); LoginResponseInfoBean bean = RemoteAuthorityRepository.getInstance().login(createLoginBean(connectionInfo));
// 服务器如果没返回token,肯定是出问题了,直接抛出异常 // 服务器如果没返回token,肯定是出问题了,直接抛出异常
if (StringUtils.isEmpty(bean.getAccessToken())) { if (StringUtils.isEmpty(bean.getAccessToken())) {

Loading…
Cancel
Save