|
@@ -659,6 +659,17 @@ const onSubmit = () => {
|
|
|
state.params.tab = 1
|
|
|
return
|
|
|
}
|
|
|
+ if (state.params.requestParams.data?.length > 0) {
|
|
|
+ const map = new Map()
|
|
|
+ state.params.requestParams.data.forEach(v => {
|
|
|
+ map.set(v.key, v)
|
|
|
+ })
|
|
|
+ if (map.size != state.params.requestParams.data.length) {
|
|
|
+ ElMessage.error('Request Params参数键名不可重复!')
|
|
|
+ state.params.tab = 1
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
params.requestParams = state.params.requestParams.data.length > 0 ? JSON.stringify(state.params.requestParams.data) : null
|
|
|
if (state.form.pluginType === 'http') {
|
|
|
// requestHeaders
|
|
@@ -667,6 +678,17 @@ const onSubmit = () => {
|
|
|
state.params.tab = 2
|
|
|
return
|
|
|
}
|
|
|
+ if (state.params.requestHeaders.data?.length > 0) {
|
|
|
+ const map = new Map()
|
|
|
+ state.params.requestHeaders.data.forEach(v => {
|
|
|
+ map.set(v.key, v)
|
|
|
+ })
|
|
|
+ if (map.size != state.params.requestHeaders.data.length) {
|
|
|
+ ElMessage.error('Request Headers参数键名不可重复!')
|
|
|
+ state.params.tab = 2
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
params.requestHeaders = state.params.requestHeaders.data.length > 0 ? JSON.stringify(state.params.requestHeaders.data) : null
|
|
|
// requestBody
|
|
|
if (!state.params.requestBody.data.every(v => proxy.$util.isValue(v.key) && (v.type == 2 || v.type != 2 && proxy.$util.isValue(v.value)) && proxy.$util.isValue(v.label) && proxy.$util.isValue(v.type) && (v.type != 3 || v.type == 3 && v.valueTable.length > 0))) {
|
|
@@ -674,6 +696,17 @@ const onSubmit = () => {
|
|
|
state.params.tab = 3
|
|
|
return
|
|
|
}
|
|
|
+ if (state.params.requestBody.data?.length > 0) {
|
|
|
+ const map = new Map()
|
|
|
+ state.params.requestBody.data.forEach(v => {
|
|
|
+ map.set(v.key, v)
|
|
|
+ })
|
|
|
+ if (map.size != state.params.requestBody.data.length) {
|
|
|
+ ElMessage.error('Request Body参数键名不可重复!')
|
|
|
+ state.params.tab = 3
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
if (['RAW_JSON', 'RAW_TEXT', 'RAW_XML', 'RAW_HTML'].includes(state.params.requestBody.type) && state.params.requestBody.data.length > 0) {
|
|
|
try {
|
|
|
tableToJson()
|