Commit 1f3e0a2d by Sixong.Zhu

Merge branch 'master' into pre

parents 9e69ee3f 70a6e97e
Showing with 1 additions and 17 deletions
...@@ -31,7 +31,6 @@ class WebMonitor { ...@@ -31,7 +31,6 @@ class WebMonitor {
private key = ""; private key = "";
private envir = ImEnvironment.Dev; private envir = ImEnvironment.Dev;
private product = Product.Default; private product = Product.Default;
private cachedUa = '';
private readonly url = "https://pre-hrs-monitor.hrs100.com"; private readonly url = "https://pre-hrs-monitor.hrs100.com";
public updateKey(key: string) { public updateKey(key: string) {
...@@ -85,21 +84,6 @@ class WebMonitor { ...@@ -85,21 +84,6 @@ class WebMonitor {
); );
} }
private getUa() {
if (!this.cachedUa) {
const build = (t: string, c: string) => `<span class="${c}">${t}</span>`
this.cachedUa = window.navigator.userAgent
.replace(/Android/ig, build('Android', 'primary'))
.replace(/iPhone/ig, build('iPhone', 'primary'))
.replace(/Mac OS X/ig, build('Mac OS X', 'primary'))
.replace(/QQXBUA/ig, build('QQXBUA', 'secondary'))
.replace(/isFlutter/ig, build('isFlutter', 'secondary'))
.replace(/\"version\"/ig, build('"version"', 'secondary'));
}
return this.cachedUa;
}
public useSdk(sdk: UniplatSdk, options: SdkMonitorOption) { public useSdk(sdk: UniplatSdk, options: SdkMonitorOption) {
this.envir = options.envir; this.envir = options.envir;
this.product = options.product; this.product = options.product;
...@@ -116,7 +100,7 @@ class WebMonitor { ...@@ -116,7 +100,7 @@ class WebMonitor {
options && options &&
options.userAgent && options.userAgent &&
msg.push(`UserAgent: ${this.getUa()}`); msg.push(`UserAgent: ${window.navigator.userAgent}`);
r.config && r.config.data && msg.push(`Payload: ${JSON.stringify(r.config.data)}`); r.config && r.config.data && msg.push(`Payload: ${JSON.stringify(r.config.data)}`);
msg.push( msg.push(
......
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 sign in to comment