fix: compile error
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
6c0bb75561
commit
3e6c7b2d8c
@ -18,13 +18,13 @@ interface RequestConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function request(config: RequestConfig) {
|
function request(config: RequestConfig) {
|
||||||
|
// @ts-ignore
|
||||||
let xhr = new XMLHttpRequest();
|
let xhr = new XMLHttpRequest();
|
||||||
xhr.open(config.method, config.url, false);
|
xhr.open(config.method, config.url, false);
|
||||||
for (const header in config.headers) {
|
for (const header in config.headers) {
|
||||||
xhr.setRequestHeader(header, config.headers[header]);
|
xhr.setRequestHeader(header, config.headers[header]);
|
||||||
}
|
}
|
||||||
let future = xhr.send(config.data);
|
let future = xhr.send(config.data);
|
||||||
// @ts-ignore
|
|
||||||
return future.get();
|
return future.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user