mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-04 03:36:29 +08:00
feat: enhance authentication flow by adding server configuration check and login handling in authStore
This commit is contained in:
@@ -121,7 +121,7 @@ export class API {
|
||||
}
|
||||
|
||||
async getFavorites(key?: string): Promise<Record<string, Favorite> | Favorite | null> {
|
||||
const url = key ? `/api/favorites?key=${key}` : "/api/favorites";
|
||||
const url = key ? `/api/favorites?key=${encodeURIComponent(key)}` : "/api/favorites";
|
||||
const response = await this._fetch(url);
|
||||
return response.json();
|
||||
}
|
||||
@@ -136,7 +136,7 @@ export class API {
|
||||
}
|
||||
|
||||
async deleteFavorite(key?: string): Promise<{ success: boolean }> {
|
||||
const url = key ? `/api/favorites?key=${key}` : "/api/favorites";
|
||||
const url = key ? `/api/favorites?key=${encodeURIComponent(key)}` : "/api/favorites";
|
||||
const response = await this._fetch(url, { method: "DELETE" });
|
||||
return response.json();
|
||||
}
|
||||
@@ -156,7 +156,7 @@ export class API {
|
||||
}
|
||||
|
||||
async deletePlayRecord(key?: string): Promise<{ success: boolean }> {
|
||||
const url = key ? `/api/playrecords?key=${key}` : "/api/playrecords";
|
||||
const url = key ? `/api/playrecords?key=${encodeURIComponent(key)}` : "/api/playrecords";
|
||||
const response = await this._fetch(url, { method: "DELETE" });
|
||||
return response.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user