Commit 06dc4f77 authored by aiduck's avatar aiduck

protocol not in webworker

parent 88254fab
{
"name": "@tuia/rip",
"version": "0.1.8",
"version": "0.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
......@@ -7,6 +7,7 @@ class Monitor {
listenedRoute = false;
tracksWorker = new TracksWorker();
init({ system, userIdentifier, env = "prod", log = false, path = "/" }) {
let protocol = document.location.protocol;
if (!system || !userIdentifier) {
console.error("system,userIdentifier是必传的");
}
......@@ -19,6 +20,7 @@ class Monitor {
userIdentifier,
env,
log,
protocol
},
});
this.initialized = true;
......
......@@ -9,6 +9,7 @@ class Reporter {
system: "",
userIdentifier: "",
path: "",
protocol: ""
};
recordKey = "";
environmentUrl = ""; // 环境配置
......@@ -31,11 +32,10 @@ class Reporter {
}
// 设置系统环境变量
setEnvironment(env) {
let protocol = document.location.protocol;
if (env === "dev") {
this.environmentUrl = `${protocol}/hunter.duibadev.com.cn`;
this.environmentUrl = `${this.baseInfo.protocol}/hunter.duibadev.com.cn`;
} else if (env === "prod") {
this.environmentUrl = `${protocol}/hunter.dui88.com`;
this.environmentUrl = `${this.baseInfo.protocol}/hunter.dui88.com`;
}
}
// 上传CDN
......
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