企业管理完善新增
parent
2cbfcd45f2
commit
5d30b3b22e
|
@ -65,6 +65,21 @@ export function sendrequest1(options){
|
|||
})
|
||||
}
|
||||
|
||||
export function sendrequest2(options){
|
||||
// 确保options是一个对象,并且包含必要的属性
|
||||
if (!options || typeof options !== 'object' || !options.apiRouter ) {
|
||||
throw new Error('Invalid options: must be an object with apiRouter ');
|
||||
}
|
||||
// 构建完整的URL
|
||||
const fullUrl = `/background/api/${options.apiRouter}`;
|
||||
return request({
|
||||
url:fullUrl,
|
||||
method: "post"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<el-form-item label="请求方式" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.requestMethod" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求参数" prop="pass" v-if="ruleForm.productName!=='新闻头条' && 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-form-item>
|
||||
<div v-if="ruleForm.productName=='新闻头条'">
|
||||
|
@ -119,12 +119,18 @@
|
|||
<span>传1时返回单号,默认不返回单号(建议传入)</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item v-if="ruleForm.productName!=='新闻头条' && ruleForm.productName!=='身份证实名认证'">
|
||||
<!--一个参数-->
|
||||
<el-form-item v-if="ruleForm.productName=='手机号码归属地' && ruleForm.productName=='万年历'">
|
||||
<el-button type="primary" @click="submitForm(ruleForm)">发送请求</el-button>
|
||||
</el-form-item>
|
||||
<!--多个参数-->
|
||||
<el-form-item v-if="ruleForm.productName=='新闻头条' ||ruleForm.productName=='身份证实名认证' " >
|
||||
<el-button type="primary" @click="newsForm(ruleForm)">发送请求</el-button>
|
||||
</el-form-item>
|
||||
<!--无参数-->
|
||||
<el-form-item v-if="ruleForm.productName=='朋友圈文案'" >
|
||||
<el-button type="primary" @click="noForm(ruleForm)">发送请求</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<pre id="json-display">
|
||||
|
||||
|
@ -210,7 +216,7 @@
|
|||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
//例如:import 《组件名称》 from '《组件路径》,
|
||||
import {findcount, iftest, reducetestcount, sendrequest, sendrequest1} from "@/api/apitest/apitest";
|
||||
import {findcount, iftest, reducetestcount, sendrequest, sendrequest1, sendrequest2} from "@/api/apitest/apitest";
|
||||
import api from "js-cookie";
|
||||
import {companyauthentication, ifcompanyauthentication} from "@/api/authentication/authentication";
|
||||
import {selectproductspecification} from "@/api/market/product";
|
||||
|
@ -315,6 +321,45 @@ export default {
|
|||
productContent:this.myapi.productContent,
|
||||
}
|
||||
},
|
||||
//测试发送请求 无参数
|
||||
noForm(ruleForm){
|
||||
sendrequest2(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>Content: ' + jsonData.result.content + '</p>';
|
||||
resultDiv.innerHTML += '<p>Source: ' + jsonData.result.source + '</p>';
|
||||
// 注意:原始JSON中没有realname, idcard, orderid, res这些字段
|
||||
} else {
|
||||
resultDiv.innerHTML += '<p>Result information is not available.</p>';
|
||||
}
|
||||
// 将结果div添加到容器中
|
||||
container.appendChild(resultDiv);
|
||||
})
|
||||
//测试次数-1
|
||||
reducetestcount(this.myapi).then(response=>{})
|
||||
},
|
||||
//测试发送请求 单个参数
|
||||
submitForm(ruleForm){
|
||||
sendrequest(ruleForm).then(response=>{
|
||||
|
@ -428,8 +473,7 @@ export default {
|
|||
})
|
||||
}
|
||||
//测试次数-1
|
||||
reducetestcount(this.myapi).then(response=>{
|
||||
})
|
||||
reducetestcount(this.myapi).then(response=>{})
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -52,56 +52,56 @@
|
|||
</el-row>
|
||||
|
||||
|
||||
<!--提示需要验证--->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false">
|
||||
<span>亲,需要认证才能使用哦!!!</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="validationYes()">去认证</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- <!–提示需要验证-–>-->
|
||||
<!-- <el-dialog-->
|
||||
<!-- title="提示"-->
|
||||
<!-- :visible.sync="dialogVisible"-->
|
||||
<!-- width="30%"-->
|
||||
<!-- :before-close="handleClose"-->
|
||||
<!-- :close-on-click-modal="false">-->
|
||||
<!-- <span>亲,需要认证才能使用哦!!!</span>-->
|
||||
<!-- <span slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
|
||||
<!-- <el-button type="primary" @click="validationYes()">去认证</el-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- </el-dialog>-->
|
||||
|
||||
<!---企业验证页面-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible1"
|
||||
width="30%"
|
||||
:before-close="handleClose1"
|
||||
:close-on-click-modal="false">
|
||||
<span>企业信息</span>
|
||||
<el-divider></el-divider>
|
||||
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="企业名称" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户姓名" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户职位" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司所在省市区" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司详细地址" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="统一社会信用代码" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="营业执照" prop="pass">
|
||||
<el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="push()">提交认证申请</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- <!–-企业验证页面–>-->
|
||||
<!-- <el-dialog-->
|
||||
<!-- title="提示"-->
|
||||
<!-- :visible.sync="dialogVisible1"-->
|
||||
<!-- width="30%"-->
|
||||
<!-- :before-close="handleClose1"-->
|
||||
<!-- :close-on-click-modal="false">-->
|
||||
<!-- <span>企业信息</span>-->
|
||||
<!-- <el-divider></el-divider>-->
|
||||
<!-- <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">-->
|
||||
<!-- <el-form-item label="企业名称" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="用户姓名" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="用户职位" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="公司所在省市区" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="公司详细地址" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="统一社会信用代码" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="营业执照" prop="pass">-->
|
||||
<!-- <el-input type="text" v-model="ruleForm.pass" autocomplete="off"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <span slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="primary" @click="push()">提交认证申请</el-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- </el-dialog>-->
|
||||
|
||||
<!--充值页面-->
|
||||
<el-dialog
|
||||
|
@ -115,18 +115,19 @@
|
|||
<el-form :model="moneyForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="请选择">
|
||||
<el-radio-group v-model="moneyForm.resource">
|
||||
<el-radio label="5"></el-radio>
|
||||
<el-radio label="20"></el-radio>
|
||||
<el-radio label="50"></el-radio>
|
||||
<el-radio label="100"></el-radio>
|
||||
<el-radio label="5">5元</el-radio>
|
||||
<el-radio label="20">20元</el-radio>
|
||||
<el-radio label="50">50元</el-radio>
|
||||
<el-radio label="100">100元</el-radio>
|
||||
<el-radio label="">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="自定义充值" prop="pass" style="width: 50%">
|
||||
<el-input type="text" v-model="moneyForm.pass" autocomplete="off"></el-input>
|
||||
<el-form-item v-if="moneyForm.resource === ''" label="自定义充值" prop="pass" style="width: 50%">
|
||||
<el-input type="text" v-model="moneyForm.resource1" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-divider></el-divider>
|
||||
<el-form-item label="选择支付方式">
|
||||
<el-radio-group v-model="moneyForm.resource">
|
||||
<el-radio-group v-model="moneyForm.pay">
|
||||
<el-radio label="1">支付宝</el-radio>
|
||||
<el-radio label="2">微信</el-radio>
|
||||
<el-radio label="3">银行卡</el-radio>
|
||||
|
@ -134,7 +135,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="insertmoney()">充值</el-button>
|
||||
<el-button type="primary" @click="insertmoney(moneyForm)">充值</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
@ -186,11 +187,19 @@ export default {
|
|||
this.dialogVisible2=true
|
||||
},
|
||||
//确认充值
|
||||
insertmoney(){
|
||||
this.dialogVisible2=false
|
||||
// addmoney(this.companymessage).then(response=>{
|
||||
//
|
||||
// })
|
||||
insertmoney(moneyForm){
|
||||
if (moneyForm.pay==1){
|
||||
if (moneyForm.resource!=''){
|
||||
window.open("http://localhost:9701/alipay/pay?ordersPrice="+moneyForm.resource)
|
||||
this.$message.success('付款成功')
|
||||
}else {
|
||||
window.open("http://localhost:9701/alipay/pay?ordersPrice="+moneyForm.resource)
|
||||
this.$message.success('付款成功')
|
||||
}
|
||||
|
||||
}
|
||||
// this.dialogVisible2=false
|
||||
|
||||
},
|
||||
//申请其他接口
|
||||
otherapi(){
|
||||
|
|
Loading…
Reference in New Issue