企业管理完善新增
parent
143527169a
commit
2cbfcd45f2
|
@ -86,7 +86,7 @@
|
||||||
<el-form-item label="请求方式" prop="pass">
|
<el-form-item label="请求方式" prop="pass">
|
||||||
<el-input type="text" v-model="ruleForm.requestMethod" autocomplete="off"></el-input>
|
<el-input type="text" v-model="ruleForm.requestMethod" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="请求参数" prop="pass" v-if="ruleForm.productName!=='新闻头条'" >
|
<el-form-item label="请求参数" prop="pass" v-if="ruleForm.productName!=='新闻头条' && ruleForm.productName!=='身份证实名认证'" >
|
||||||
<el-input type="text" v-model="ruleForm.parameter" autocomplete="off"></el-input>
|
<el-input type="text" v-model="ruleForm.parameter" autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div v-if="ruleForm.productName=='新闻头条'">
|
<div v-if="ruleForm.productName=='新闻头条'">
|
||||||
|
@ -107,10 +107,22 @@
|
||||||
<span>说明:是否只返回有内容详情的新闻, 1:是, 默认0</span>
|
<span>说明:是否只返回有内容详情的新闻, 1:是, 默认0</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<el-form-item v-if="ruleForm.productName!=='新闻头条'">
|
<div v-if="ruleForm.productName=='身份证实名认证'">
|
||||||
|
<el-form-item label="身份证号码" prop="pass" >
|
||||||
|
<el-input type="text" v-model="ruleForm.idcard" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="姓名" prop="pass">
|
||||||
|
<el-input type="text" v-model="ruleForm.realname" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否返回单号" prop="pass" >
|
||||||
|
<el-input type="text" v-model="ruleForm.orderid" autocomplete="off"></el-input>
|
||||||
|
<span>传1时返回单号,默认不返回单号(建议传入)</span>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<el-form-item v-if="ruleForm.productName!=='新闻头条' && ruleForm.productName!=='身份证实名认证'">
|
||||||
<el-button type="primary" @click="submitForm(ruleForm)">发送请求</el-button>
|
<el-button type="primary" @click="submitForm(ruleForm)">发送请求</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="ruleForm.productName=='新闻头条'">
|
<el-form-item v-if="ruleForm.productName=='新闻头条' ||ruleForm.productName=='身份证实名认证' " >
|
||||||
<el-button type="primary" @click="newsForm(ruleForm)">发送请求</el-button>
|
<el-button type="primary" @click="newsForm(ruleForm)">发送请求</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -320,41 +332,41 @@ export default {
|
||||||
},
|
},
|
||||||
//测试发送请求 多个参数
|
//测试发送请求 多个参数
|
||||||
newsForm(ruleForm) {
|
newsForm(ruleForm) {
|
||||||
sendrequest1(ruleForm).then(response => {
|
if (ruleForm.productName=='新闻头条'){
|
||||||
console.log(response)
|
sendrequest1(ruleForm).then(response => {
|
||||||
const jsonData1 = response.data; // 假设response.data是解析后的JSON对象
|
console.log(response)
|
||||||
|
const jsonData1 = response.data; // 假设response.data是解析后的JSON对象
|
||||||
|
|
||||||
// 解析JSON字符串为JavaScript对象
|
// 解析JSON字符串为JavaScript对象
|
||||||
const jsonData = JSON.parse(jsonData1);
|
const jsonData = JSON.parse(jsonData1);
|
||||||
|
|
||||||
// 创建一个容器来展示数据
|
// 创建一个容器来展示数据
|
||||||
var container = document.getElementById('news-list');
|
var container = document.getElementById('news-list');
|
||||||
// 清空容器内容
|
// 清空容器内容
|
||||||
container.innerHTML = '';
|
container.innerHTML = '';
|
||||||
|
|
||||||
// 创建一个div来存放结果
|
// 创建一个div来存放结果
|
||||||
var resultDiv = document.createElement('div');
|
var resultDiv = document.createElement('div');
|
||||||
|
|
||||||
// 检查jsonData.reason
|
// 检查jsonData.reason
|
||||||
if (jsonData.reason !== undefined) {
|
if (jsonData.reason !== undefined) {
|
||||||
// 移除reason中的感叹号(如果存在)
|
// 移除reason中的感叹号(如果存在)
|
||||||
resultDiv.innerHTML += '<h2>Reason: ' + jsonData.reason.replace(/!/g, '') + '</h2>';
|
resultDiv.innerHTML += '<h2>Reason: ' + jsonData.reason.replace(/!/g, '') + '</h2>';
|
||||||
} else {
|
} else {
|
||||||
resultDiv.innerHTML += '<h2>Reason: Not available</h2>';
|
resultDiv.innerHTML += '<h2>Reason: Not available</h2>';
|
||||||
}
|
}
|
||||||
|
// 检查jsonData.result
|
||||||
|
if (jsonData.result !== undefined) {
|
||||||
|
// 添加其他结果信息
|
||||||
|
resultDiv.innerHTML += '<p>Stat: ' + jsonData.result.stat + '</p>';
|
||||||
|
resultDiv.innerHTML += '<p>Page: ' + jsonData.result.page + '</p>';
|
||||||
|
resultDiv.innerHTML += '<p>Page Size: ' + jsonData.result.pageSize + '</p>';
|
||||||
|
|
||||||
// 检查jsonData.result
|
// 检查jsonData.result.data
|
||||||
if (jsonData.result !== undefined) {
|
if (Array.isArray(jsonData.result.data)) {
|
||||||
// 添加其他结果信息
|
// 遍历数据并生成HTML
|
||||||
resultDiv.innerHTML += '<p>Stat: ' + jsonData.result.stat + '</p>';
|
jsonData.result.data.forEach(item => {
|
||||||
resultDiv.innerHTML += '<p>Page: ' + jsonData.result.page + '</p>';
|
resultDiv.innerHTML += `
|
||||||
resultDiv.innerHTML += '<p>Page Size: ' + jsonData.result.pageSize + '</p>';
|
|
||||||
|
|
||||||
// 检查jsonData.result.data
|
|
||||||
if (Array.isArray(jsonData.result.data)) {
|
|
||||||
// 遍历数据并生成HTML
|
|
||||||
jsonData.result.data.forEach(item => {
|
|
||||||
resultDiv.innerHTML += `
|
|
||||||
<div>
|
<div>
|
||||||
<h3>${item.title}</h3>
|
<h3>${item.title}</h3>
|
||||||
<p>Unique Key: ${item.uniquekey}</p>
|
<p>Unique Key: ${item.uniquekey}</p>
|
||||||
|
@ -364,18 +376,57 @@ export default {
|
||||||
<p>URL: <a href="${item.url.replace(/\\/g, '')}">${item.url}</a></p>
|
<p>URL: <a href="${item.url.replace(/\\/g, '')}">${item.url}</a></p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
resultDiv.innerHTML += '<p>No data available.</p>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
resultDiv.innerHTML += '<p>No data available.</p>';
|
resultDiv.innerHTML += '<p>Result information is not available.</p>';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resultDiv.innerHTML += '<p>Result information is not available.</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将结果div添加到容器中
|
// 将结果div添加到容器中
|
||||||
container.appendChild(resultDiv);
|
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 += '<h2>Reason: ' + jsonData.reason.replace(/!/g, '') + '</h2>';
|
||||||
|
} else {
|
||||||
|
resultDiv.innerHTML += '<h2>Reason: Not available</h2>';
|
||||||
|
}
|
||||||
|
// 检查jsonData.result
|
||||||
|
if (jsonData.result !== undefined) {
|
||||||
|
// 添加result中的信息
|
||||||
|
resultDiv.innerHTML += '<p>Real Name: ' + jsonData.result.realname + '</p>';
|
||||||
|
resultDiv.innerHTML += '<p>ID Card: ' + jsonData.result.idcard + '</p>';
|
||||||
|
resultDiv.innerHTML += '<p>Order ID: ' + jsonData.result.orderid + '</p>';
|
||||||
|
resultDiv.innerHTML += '<p>Result: ' + jsonData.result.res + '</p>';
|
||||||
|
} else {
|
||||||
|
resultDiv.innerHTML += '<p>Result information is not available.</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将结果div添加到容器中
|
||||||
|
container.appendChild(resultDiv);
|
||||||
|
})
|
||||||
|
}
|
||||||
//测试次数-1
|
//测试次数-1
|
||||||
reducetestcount(this.myapi).then(response=>{
|
reducetestcount(this.myapi).then(response=>{
|
||||||
})
|
})
|
||||||
|
|
|
@ -8,19 +8,18 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="20"><div class="grid-content bg-purple">
|
<el-col :span="20"><div class="grid-content bg-purple">
|
||||||
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||||
<el-select v-model="ruleForm.productState" placeholder="请选择状态">
|
<!-- <el-select v-model="ruleForm.productState" placeholder="请选择状态">-->
|
||||||
<el-option
|
<!-- <el-option-->
|
||||||
v-for="item in options"
|
<!-- v-for="item in options"-->
|
||||||
:key="item.value"
|
<!-- :key="item.value"-->
|
||||||
:label="item.label"
|
<!-- :label="item.label"-->
|
||||||
:value="item.value">
|
<!-- :value="item.value">-->
|
||||||
</el-option>
|
<!-- </el-option>-->
|
||||||
</el-select>
|
<!-- </el-select>-->
|
||||||
<el-input type="text" v-model="ruleForm.productName" style="width: 200px" autocomplete="off" placeholder="名称搜索"></el-input>
|
<el-input type="text" v-model="ruleForm.productName" style="width: 200px" autocomplete="off" placeholder="名称搜索"></el-input>
|
||||||
<el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
<el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div></el-col>
|
</div></el-col>
|
||||||
<el-col :span="4"><div class="grid-content bg-purple-light"><el-button type="primary">新增数据</el-button></div></el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="12">
|
<el-row :gutter="12">
|
||||||
|
|
Loading…
Reference in New Issue