make slim pack

This commit is contained in:
bridge
2025-11-22 18:05:58 +08:00
parent 39be21ae26
commit e7a630b143
6 changed files with 34 additions and 15 deletions

View File

@@ -6,8 +6,11 @@
const API_BASE = ''; // 相对路径
export class ApiError extends Error {
constructor(public status: number, message: string) {
public status: number;
constructor(status: number, message: string) {
super(message);
this.status = status;
this.name = 'ApiError';
}
}

View File

@@ -19,8 +19,11 @@ export class GameSocket {
private reconnectTimer: number | null = null;
private attempts = 0;
private isIntentionalClose = false;
private options: SocketOptions;
constructor(private options: SocketOptions = {}) {}
constructor(options: SocketOptions = {}) {
this.options = options;
}
public connect() {
this.isIntentionalClose = false;