Stat: ' + jsonData.result.stat + '
'; + resultDiv.innerHTML += 'Page: ' + jsonData.result.page + '
'; + resultDiv.innerHTML += 'Page Size: ' + jsonData.result.pageSize + '
'; - // 检查jsonData.result - if (jsonData.result !== undefined) { - // 添加其他结果信息 - resultDiv.innerHTML += 'Stat: ' + jsonData.result.stat + '
'; - resultDiv.innerHTML += 'Page: ' + jsonData.result.page + '
'; - resultDiv.innerHTML += 'Page Size: ' + jsonData.result.pageSize + '
'; - - // 检查jsonData.result.data - if (Array.isArray(jsonData.result.data)) { - // 遍历数据并生成HTML - jsonData.result.data.forEach(item => { - resultDiv.innerHTML += ` + // 检查jsonData.result.data + if (Array.isArray(jsonData.result.data)) { + // 遍历数据并生成HTML + jsonData.result.data.forEach(item => { + resultDiv.innerHTML += ` `; - }); + }); + } else { + resultDiv.innerHTML += 'No data available.
'; + } } else { - resultDiv.innerHTML += 'No data available.
'; + resultDiv.innerHTML += 'Result information is not available.
'; } - } else { - resultDiv.innerHTML += 'Result information is not available.
'; - } - // 将结果div添加到容器中 - container.appendChild(resultDiv); + // 将结果div添加到容器中 + container.appendChild(resultDiv); - }); + }); + } + if (ruleForm.productName=='身份证实名认证'){ + sendrequest1(ruleForm).then(response => { + console.log(response) + const jsonData1 = response.data; // 假设response.data是解析后的JSON对象 + + // 解析JSON字符串为JavaScript对象 + const jsonData = JSON.parse(jsonData1); + + // 创建一个容器来展示数据 + var container = document.getElementById('news-list'); + // 清空容器内容 + container.innerHTML = ''; + + // 创建一个div来存放结果 + var resultDiv = document.createElement('div'); + + // 检查jsonData.reason + if (jsonData.reason !== undefined) { + // 移除reason中的感叹号(如果存在) + resultDiv.innerHTML += 'Real Name: ' + jsonData.result.realname + '
'; + resultDiv.innerHTML += 'ID Card: ' + jsonData.result.idcard + '
'; + resultDiv.innerHTML += 'Order ID: ' + jsonData.result.orderid + '
'; + resultDiv.innerHTML += 'Result: ' + jsonData.result.res + '
'; + } else { + resultDiv.innerHTML += 'Result information is not available.
'; + } + + // 将结果div添加到容器中 + container.appendChild(resultDiv); + }) + } //测试次数-1 reducetestcount(this.myapi).then(response=>{ }) diff --git a/src/views/market/myapi/index.vue b/src/views/market/myapi/index.vue index b719245..7644a11 100644 --- a/src/views/market/myapi/index.vue +++ b/src/views/market/myapi/index.vue @@ -8,19 +8,18 @@