mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2026-04-22 22:57:15 +08:00
19 lines
562 B
TypeScript
19 lines
562 B
TypeScript
// import http from "http";
|
|
|
|
// export function upload(url: string, data: Object) {
|
|
// let h = new Image();
|
|
// h.onerror = function () {};
|
|
// h.src = url + "?log=" + encodeURIComponent(data.toString());
|
|
|
|
// const req = http.request(url, { method: "POST" }, (res: any) => {
|
|
// res.setEncoding("utf8");
|
|
// res.on("data", (chunk) => {});
|
|
// // 监听接口请求完成, 除非error,最终都会执行end;
|
|
// res.on("end", () => {});
|
|
// });
|
|
// req.on("error", (e) => {});
|
|
// // 写入请求的数据
|
|
// data && req.write(data);
|
|
// req.end();
|
|
// }
|