url.js
const baseUrl="http://地址"
// const baseUrl="http:地址"
const api ={
//数据可视化
dataVisual:{
qryEnterpriseInfo:baseUrl+"/dataVisual/qryEnterpriseInfo",
qryRiskPointInspectList:baseUrl+"/dataVisual/qryRiskPointInspectList"
},
DataStatistics:{
exportEmpDataStatistics:baseUrl+"/DataStatistics/exportEmpDataStatistics",
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>真实地址请求</title>
</head>
<body>
<script src="https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.min.js"></script>
<script src="js/urls.js"></script>
<script>
var id=571;
// axios.post(api.dataVisual.qryEnterpriseInfo,{enterpriseId:id})
axios.post(api.dataVisual.qryEnterpriseInfo+"?enterpriseId="+id).then((res)=>{
console.log(res)
})
</script>
</body>
</html>
网友评论