refactor: remove redundant monitor files

This commit is contained in:
liujuping 2022-06-23 11:52:53 +08:00 committed by 林熠
parent 8f237b1089
commit 2022308e21
2 changed files with 0 additions and 43 deletions

View File

@ -1,5 +1,4 @@
export * from './get-public-path';
export * from './monitor';
export * from './obx';
export * from './request';
export * from './focus-tracker';

View File

@ -1,42 +0,0 @@
export class Monitor {
fn = (params: any) => {
const { AES = {} } = window as any;
if (typeof AES.log === 'function') {
const { p1 = '', p2 = '', p3 = '', p4 = 'OTHER', ...rest } = params || {};
AES.log('event', {
p1,
p2,
p3,
p4,
...rest,
});
}
};
register(fn: () => any) {
if (typeof fn === 'function') {
this.fn = fn;
}
}
log(params: any) {
if (typeof this.fn === 'function') {
this.fn(params);
}
}
setConfig(key: string | object, value?: string): void {
const { AES = {} } = window as any;
if (typeof AES?.setConfig !== 'function') {
return;
}
if (typeof key === 'string' && value) {
AES.setConfig(key, value);
} else if (typeof key === 'object') {
AES.setConfig(key);
}
}
}
const monitor = new Monitor();
export { monitor };