refactor(系统设置): 在Jira里面填写禅道信息测试连接成功

--bug=1013182 --user=李玉号 [系统设置]gihtub#13565在Jira里面填写禅道信息,测试成功
https://www.tapd.cn/55049933/s/1158316

Closes #13565
This commit is contained in:
shiziyuan9527 2022-05-16 11:37:15 +08:00 committed by shiziyuan9527
parent 8c8e15a593
commit 34a68f2739
4 changed files with 8 additions and 1 deletions

View File

@ -182,8 +182,12 @@ public abstract class JiraAbstractClient extends BaseClient {
}
public void auth() {
ResponseEntity<String> response = null;
try {
restTemplate.exchange(getBaseUrl() + "/myself", HttpMethod.GET, getAuthHttpEntity(), String.class);
response = restTemplate.exchange(getBaseUrl() + "/myself", HttpMethod.GET, getAuthHttpEntity(), String.class);
if (StringUtils.isNotBlank(response.getBody()) && !response.getBody().startsWith("{\"self\"")) {
MSException.throwException(Translator.get("jira_auth_url_error"));
}
} catch (HttpClientErrorException e) {
if (e.getRawStatusCode() == 401) {
MSException.throwException(Translator.get("jira_auth_error"));

View File

@ -321,3 +321,4 @@ error_code_is_unique=Error code is not unique
no_version_exists=version not exists
jira_auth_error=Account name or password (Token) is wrong
jira_auth_url_error=The test connection failed, please check whether the Jira address is correct

View File

@ -319,3 +319,4 @@ issue_jira_info_error=请检查服务集成信息或Jira项目ID
error_code_is_unique=错误代码不可重复
no_version_exists=不存在版本!请先创建项目的版本
jira_auth_error=账号名或密码(Token)错误
jira_auth_url_error=测试连接失败请检查Jira地址是否正确

View File

@ -319,3 +319,4 @@ error_code_is_unique=錯誤代碼不可重複
no_version_exists=不存在版本!請先創建項目的版本
jira_auth_error=賬號名或密碼(Token)錯誤
jira_auth_url_error=測試連接失敗請檢查Jira地址是否正確