This commit is contained in:
JS-LM
2023-06-13 17:02:28 +08:00
parent 0036813ae9
commit b021ef71ad

View File

@@ -458,9 +458,17 @@ export default {
// 查询汇付结算账户
selectSettleAccount() {},
jsonHttp(){
const res = this.$http.get('https://cdn.cloudpnr.com/adapayresource/documents/Adapay%E7%9C%81%E5%B8%82%E7%BC%96%E7%A0%81%EF%BC%88%E5%9B%9B%E4%BD%8D%EF%BC%89.json');
console.log("res:", res);
this.options = res;
//(1).实例化ajax对象
let xhr = new XMLHttpRequest()
//(2).设置请求方法和地址
//get请求的数据直接添加在url的后面 格式是 url?key=value
xhr.open('get', 'https://cdn.cloudpnr.com/adapayresource/documents/Adapay%E7%9C%81%E5%B8%82%E7%BC%96%E7%A0%81%EF%BC%88%E5%9B%9B%E4%BD%8D%EF%BC%89.json')
//(3).发送请求
xhr.send()
//(4).注册回调函数
xhr.onload = function() {
console.log(xhr.responseText,'responseText')
}
}
},
created() {