diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue b/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue index 0ca0d17a7b..45bfd70bef 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiAssertions.vue @@ -207,10 +207,14 @@ export default { suggestJsonOpen() { this.$emit('suggestClick'); this.$nextTick(() => { - if (!this.response || !this.response.responseResult || !this.response.responseResult.body) { + if (!this.response || !this.response.responseResult) { this.$message(this.$t('api_test.request.assertions.debug_first')); return; } + if (!this.response.responseResult.body) { + this.$message(this.$t('api_test.request.assertions.body_is_null')); + return; + } this.$refs.jsonpathSuggest.open(this.response.responseResult.body); }); }, diff --git a/api-test/frontend/src/business/definition/components/assertion/GlobalAssertions.vue b/api-test/frontend/src/business/definition/components/assertion/GlobalAssertions.vue index 881fd06573..b900efd354 100644 --- a/api-test/frontend/src/business/definition/components/assertion/GlobalAssertions.vue +++ b/api-test/frontend/src/business/definition/components/assertion/GlobalAssertions.vue @@ -167,10 +167,14 @@ export default { suggestJsonOpen() { this.$emit('suggestClick'); this.$nextTick(() => { - if (!this.response || !this.response.responseResult || !this.response.responseResult.body) { + if (!this.response || !this.response.responseResult) { this.$message(this.$t('api_test.request.assertions.debug_first')); return; } + if (!this.response.responseResult.body) { + this.$message(this.$t('api_test.request.assertions.body_is_null')); + return; + } this.$refs.jsonpathSuggest.open(this.response.responseResult.body); }); }, diff --git a/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue b/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue index f1e5d2ee92..7a3cf0d6a7 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ScenarioAssertions.vue @@ -188,10 +188,14 @@ export default { suggestJsonOpen() { this.$emit('suggestClick'); this.$nextTick(() => { - if (!this.response || !this.response.responseResult || !this.response.responseResult.body) { + if (!this.response || !this.response.responseResult) { this.$message(this.$t('api_test.request.assertions.debug_first')); return; } + if (!this.response.responseResult.body) { + this.$message(this.$t('api_test.request.assertions.body_is_null')); + return; + } this.$refs.jsonpathSuggest.open(this.response.responseResult.body); }); }, diff --git a/api-test/frontend/src/business/definition/components/extract/ApiExtract.vue b/api-test/frontend/src/business/definition/components/extract/ApiExtract.vue index 59fcfbde04..4cbf403a6e 100644 --- a/api-test/frontend/src/business/definition/components/extract/ApiExtract.vue +++ b/api-test/frontend/src/business/definition/components/extract/ApiExtract.vue @@ -154,10 +154,14 @@ export default { suggestJsonOpen() { this.$emit('suggestClick'); this.$nextTick(() => { - if (!this.response || !this.response.responseResult || !this.response.responseResult.body) { + if (!this.response || !this.response.responseResult) { this.$message(this.$t('api_test.request.assertions.debug_first')); return; } + if (!this.response.responseResult.body) { + this.$message(this.$t('api_test.request.assertions.body_is_null')); + return; + } this.$refs.jsonpathSuggest.open(this.response.responseResult.body); }); }, diff --git a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiAssertions.vue b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiAssertions.vue index 569daa3b9c..a87b140370 100644 --- a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiAssertions.vue +++ b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiAssertions.vue @@ -197,10 +197,14 @@ export default { suggestJsonOpen() { this.$emit('suggestClick'); this.$nextTick(() => { - if (!this.response || !this.response.responseResult || !this.response.responseResult.body) { + if (!this.response || !this.response.responseResult) { this.$message(this.$t('api_test.request.assertions.debug_first')); return; } + if (!this.response.responseResult.body) { + this.$message(this.$t('api_test.request.assertions.body_is_null')); + return; + } this.$refs.jsonpathSuggest.open(this.response.responseResult.body); }) }, diff --git a/framework/sdk-parent/frontend/src/components/environment/assertion/GlobalAssertions.vue b/framework/sdk-parent/frontend/src/components/environment/assertion/GlobalAssertions.vue index 07835c21c7..c64e10f8ae 100644 --- a/framework/sdk-parent/frontend/src/components/environment/assertion/GlobalAssertions.vue +++ b/framework/sdk-parent/frontend/src/components/environment/assertion/GlobalAssertions.vue @@ -169,10 +169,14 @@ export default { suggestJsonOpen() { this.$emit('suggestClick'); this.$nextTick(() => { - if (!this.response || !this.response.responseResult || !this.response.responseResult.body) { + if (!this.response || !this.response.responseResult) { this.$message(this.$t('api_test.request.assertions.debug_first')); return; } + if (!this.response.responseResult.body) { + this.$message(this.$t('api_test.request.assertions.body_is_null')); + return; + } this.$refs.jsonpathSuggest.open(this.response.responseResult.body); }); }, diff --git a/framework/sdk-parent/frontend/src/i18n/lang/en-US.js b/framework/sdk-parent/frontend/src/i18n/lang/en-US.js index 965a3891e3..be6a4621c1 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/en-US.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/en-US.js @@ -1933,6 +1933,8 @@ const message = { json_path_suggest: "JSONPath Assertion Suggest", json_path_clear: "Clear JSONPath Assertion", debug_first: "First, debug to get the response", + body_is_null: + "No response data detected, please run the interface and ensure response data is generated", suggest_tip: "Click the note to add the JSONPath assertion", regex_info: 'Special characters "$ () * +. [] \\ ^ {} |" need to be escaped as "\\ "+"special characters", such as "\\$"', diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js index a5412dc967..9ff3442df5 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js @@ -1861,6 +1861,7 @@ const message = { json_path_suggest: "推荐JSONPath断言", json_path_clear: "清空JSONPath断言", debug_first: "请先执行调试获取响应结果", + body_is_null: "未检测到响应数据,请运行接口并确保产生了响应数据", ignore_status: "忽略状态", add: "添加", script_name: "脚本名称", diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js index b5df011a4d..bd1ab3434f 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js @@ -1860,6 +1860,7 @@ const message = { json_path_suggest: "推薦JSONPath斷言", json_path_clear: "清空JSONPath斷言", debug_first: "請先執行調試獲取響應結果", + body_is_null: "未檢測到響應數據,請運行介面並確保產生了響應數據", ignore_status: "忽略狀態", add: "添加", script_name: "腳本名稱",