diff --git a/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue b/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue index 7b45e2e06c..213ae0f792 100644 --- a/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue +++ b/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue @@ -511,6 +511,10 @@ } }, addFunc() { + if(this.itemValue == undefined || this.itemValue == null){ + this.$warning(this.$t('api_test.request.parameters_advance_add_mock_error')); + return; + } if(this.itemValue.indexOf('@') == -1){ this.itemValue = '@' + this.itemValue; } else { diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index c498230ece..85a93cce9c 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1456,6 +1456,7 @@ export default { parameters_advance_add_func: "Add Function", parameters_advance_add_func_limit: "Support up to 5 functions", parameters_advance_add_func_error: "Please select function first", + parameters_advance_add_mock_error: "Please select mock data first", parameters_advance_add_param_error: "Please enter function parameters", parameters_desc: "Parameters will be appended to the URL e.g. https://fit2cloud.com?Name=Value&Name2=Value2", headers: "Headers", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 69ea411fdf..4612ec4b05 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1461,6 +1461,7 @@ export default { parameters_advance_add_func: "添加函数", parameters_advance_add_func_limit: "最多支持5个函数", parameters_advance_add_func_error: "请先选择函数", + parameters_advance_add_mock_error: "请先选择mock数据", parameters_advance_add_param_error: "请输入函数参数", parameters_desc: "参数追加到URL,例如https://fit2cloud.com/entries?key1=Value1&Key2=Value2", headers: "请求头", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index f691f12f59..005b2b43a8 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1461,6 +1461,7 @@ export default { parameters_advance_add_func: "添加函數", parameters_advance_add_func_limit: "最多支持5個函數", parameters_advance_add_func_error: "請先選擇函數", + parameters_advance_add_mock_error: "請先選擇mock數據", parameters_advance_add_param_error: "請輸入函數參數", parameters_desc: "參數追加到URL,例如https://fit2cloud.com/entries?key1=Value1&Key2=Value2", headers: "請求頭",