You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
889 B

2 weeks ago
// 注:验证完后需立即禁用掉【BDP集成测试】插件
var data = JSON.stringify({
"sql": "xxx"// 要执行的SQL
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://localhost:8080/webroot/decision/jd/bdp/test/sqlTest");// 替换为实际的地址
xhr.setRequestHeader("Content-Type", "application/json");
// xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiaXNzIjoiZmFucnVhbiIsImRlc2NyaXB0aW9uIjoiMSgxKSIsImV4cCI6MTczOTMyOTU1OCwiaWF0IjoxNzM5MzI1OTU4LCJqdGkiOiJOaFF5aytGRnBGMTJlSFRVTVhCQWp2THp1TEpxb2JIQTN3VGFMOW5lcWpvcFVkSGQifQ.OVynKPOXATzl5zUm_1rflS5HkMC6goEa8g5OIWFdy6M");
// 在浏览器中执行,不需要单独传递token
xhr.send(data);