mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 19:32:27 +08:00
chore (frontend): move url in frontend
This commit is contained in:
12
public/assets/helpers/log.js
Normal file
12
public/assets/helpers/log.js
Normal file
@ -0,0 +1,12 @@
|
||||
export function report(msg, error, link, lineNo, columnNo) {
|
||||
if (window.navigator.onLine === false) return Promise.resolve();
|
||||
let url = "/report?";
|
||||
url += "url=" + encodeURIComponent(location.href) + "&";
|
||||
url += "msg=" + encodeURIComponent(msg) + "&";
|
||||
url += "from=" + encodeURIComponent(link) + "&";
|
||||
url += "from.lineNo=" + lineNo + "&";
|
||||
url += "from.columnNo=" + columnNo;
|
||||
if (error) url += "error=" + encodeURIComponent(error.message) + "&";
|
||||
|
||||
return fetch(url, { method: "post" }).catch(() => {});
|
||||
}
|
||||
Reference in New Issue
Block a user