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

19 lines
562 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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