This commit is contained in:
zhangds 2024-05-29 10:42:31 +08:00
commit 04685947c4
2 changed files with 100 additions and 0 deletions

58
dof-api.js Normal file
View File

@ -0,0 +1,58 @@
const baseurl = "http://lottery.unipay.test.86698.cn/api"; // 测试
// const baseurl = ""; // 正式
//统一请求
axios.interceptors.request.use((config) => {
return config;
});
const req = {
//get请求
axiosGet(url, params) {
const obj = { method: "get", url: baseurl + url, params };
var result = axios(obj)
.then(function (res) {
return res.data;
})
.catch(function (error) {
return;
});
return result;
},
//post请求
axiosPost(url, data) {
let result = axios({
method: "post",
url: baseurl + url,
data: data,
header: {
"Content-type": "application/x-www-form-urlencoded"
}
})
.then((res) => {
return res.data;
})
.catch((error) => {
// return "exception=" + error
});
return result;
},
//put请求
axiosPut(url, data) {
let result = axios({
method: "put",
url: baseurl + url,
data: data,
header: {
"Content-type": "application/x-www-form-urlencoded"
}
})
.then((res) => {
return res.data;
})
.catch((error) => {
alert("服务器错误");
return "exception=" + error;
});
return result;
}
};

42
index.html Normal file
View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<!-- A11Y注意设置页面的 lang 属性 -->
<html lang="zh">
<head>
<meta charset="utf-8" />
<!-- A11Y打开页面时屏幕阅读器会首先阅读 title 的内容,确保 title 准确描述页面 -->
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no, email=no" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
<!-- A11Y如果有无障碍方面的需求建议使用下面的 viewport 设置,不要禁止页面缩放 -->
<!--<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />-->
<script>
var docEl = document.documentElement;
docEl.style.fontSize = 100 / 375 * docEl.clientWidth + 'px';
window.addEventListener('resize', function () {
docEl.style.fontSize = 100 / 375 * docEl.clientWidth + 'px';
});
</script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144999"></script>
<script src="./dof-api.js"></script>
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/libs/vue.global.js"></script>
</head>
<body>
<div id="app">
银联1
</div>
</body>
<script>
const { createApp, ref } = Vue
createApp({
setup() { }
}).mount('#app')
</script>
</html>