Files
x_admin/x_error_sdk/x-log-node.ts
T
2024-10-31 01:12:07 +08:00

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();
// }