Commit 06dc4f77 authored by aiduck's avatar aiduck

protocol not in webworker

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