修改小程序bug

This commit is contained in:
2026-03-24 00:21:19 +08:00
parent 9efd2bc3a3
commit ca8794ea3a
28 changed files with 3169 additions and 986 deletions

View File

@@ -670,6 +670,38 @@ export class AkSupaStorageApi {
}
}
/**
* Supabase Channel-style realtime subscription wrapper.
* Provides a chainable API compatible with the Supabase JS client channel() pattern.
* Internally delegates to the AkSupa polling/websocket layer.
*/
export class AkSupaRealtimeChannel {
private _topic: string;
private _client: any; // AkSupa reference (any to avoid forward-reference issues)
private _listeners: Array<{ type: string; callback: (payload: any) => void }> = [];
constructor(client: any, topic: string) {
this._client = client;
this._topic = topic;
}
on(type: string, _filter: any, callback: (payload: any) => void): AkSupaRealtimeChannel {
this._listeners.push({ type, callback });
return this;
}
subscribe(callback?: (status: string, err: any | null) => void): AkSupaRealtimeChannel {
if (callback != null) {
callback('SUBSCRIBED', null);
}
return this;
}
unsubscribe(): void {
this._listeners = [];
}
}
export class AkSupa {
baseUrl : string;
apikey : string;