暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233
  1. using Codice.Client.Common;
  2. namespace Unity.PlasticSCM.Editor.Tool
  3. {
  4. internal static class AuthToken
  5. {
  6. internal static string GetForServer(string server)
  7. {
  8. ServerProfile serverProfile = CmConnection.Get().
  9. GetProfileManager().GetProfileForServer(server);
  10. string authToken = serverProfile != null ?
  11. CmConnection.Get().
  12. BuildWebApiTokenForCloudEditionForUser(
  13. serverProfile.Server,
  14. serverProfile.GetSEIDWorkingMode(),
  15. serverProfile.SecurityConfig):
  16. CmConnection.Get().
  17. BuildWebApiTokenForCloudEditionForUser(
  18. server,
  19. ClientConfig.Get().GetSEIDWorkingMode(),
  20. ClientConfig.Get().GetSecurityConfig());
  21. if (string.IsNullOrEmpty(authToken))
  22. {
  23. authToken = CmConnection.Get().
  24. BuildWebApiTokenForCloudEditionDefaultUser();
  25. }
  26. return authToken;
  27. }
  28. }
  29. }