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