Skip to content

Commit

Permalink
fix:error
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Dec 30, 2024
1 parent c87d365 commit 638fc22
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/common/umami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class UmamiTraceCore {
hostname: string = 'trace.napneko.icu';
ua: string = '';
workname: string = 'default';
bootTime = Date.now();
init(qqversion: string, guid: string, workname: string) {
this.qqversion = qqversion;
this.workname = workname;
Expand Down Expand Up @@ -43,8 +44,12 @@ export class UmamiTraceCore {
const data = {
napcat_version: this.napcatVersion,
qq_version: this.qqversion,
guid: guid,
workname: this.workname,
napcat_working: this.workname,
device_guid: this.guid,
device_platform: os.platform(),
device_arch: os.arch(),
boot_time: new Date(this.bootTime + 8 * 60 * 60 * 1000).toISOString().replace('T', ' ').substring(0, 19),
sys_time: new Date(Date.now() - os.uptime() * 1000 + 8 * 60 * 60 * 1000).toISOString().replace('T', ' ').substring(0, 19)
};
this.sendEvent(
{
Expand All @@ -70,14 +75,7 @@ export class UmamiTraceCore {
language: language || 'en-US',
screen: '1920x1080',
data: {
...data,
napcat_version: this.napcatVersion,
qq_version: this.qqversion,
workname: this.workname,
guid: this.guid,
platform: os.platform(),
arch: os.arch(),
uptime: new Date(Date.now() - os.uptime() * 1000).toISOString().replace('T', ' ').substring(0, 19)
...data
}
};
this.sendRequest(payload, type);
Expand Down

0 comments on commit 638fc22

Please sign in to comment.