Commit dc164ff2 authored by aiduck's avatar aiduck

version1.1.0

parent f9056aa0
Pipeline #155907 passed with stage
in 26 seconds
{
"name": "@tuia/rip",
"version": "1.0.6",
"version": "1.1.0",
"description": "Tools for user behavior recording and playback based on rrweb",
"main": "dist/index.js",
"scripts": {
......
......@@ -39,15 +39,15 @@ class Reporter {
}
// 上传CDN
toCDN(payload) {
const blob = new Blob([JSON.stringify(payload)], { type: "application/json" });
const formData = new FormData();
// const blob = new Blob([JSON.stringify(payload)], { type: "application/json" });
// const formData = new FormData();
// 保存上下文
const trackId = this.counter.count;
const recordKey = this.recordKey;
log("trackId", trackId);
log("recordKey", recordKey);
this.uploadingPile.add(trackId);
formData.append("file", blob, `${this.recordKey + trackId}.json`);
// formData.append("file", blob, `${this.recordKey + trackId}.json`);
const extra = {
...this.baseInfo,
recordKey: this.recordKey,
......@@ -55,11 +55,17 @@ class Reporter {
isCDN: true,
};
try {
fetch(`${this.environmentUrl}/upload`, {
// fetch(`http://localhost:3000/upload`, {
fetch(`${this.environmentUrl}/uploadString`, {
// fetch(`http://localhost:3000/uploadString`, {
method: "POST",
credentials: "include",
body: formData,
// body: formData
headers: new Headers({ "content-type": "application/json" }),
body: JSON.stringify({
payload: payload,
recordKey: recordKey,
trackId: trackId
}),
})
.then(res => {
return res.json();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment