mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-03 14:37:00 +08:00
refactor(api): adopt unified responses and restore media config hints
This commit is contained in:
@@ -149,6 +149,7 @@ export async function loadRemoteComponentFromModule(remoteModule: RemoteModule,
|
||||
async function fetchRemoteModules(): Promise<RemoteModule[]> {
|
||||
try {
|
||||
const response = (await api.get('plugin/remotes?token=moviepilot', {
|
||||
feedback: 'silent',
|
||||
signal: federationController.signal,
|
||||
})) as unknown as RemoteModule[] | null
|
||||
return response ?? []
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function fetchGlobalSettings() {
|
||||
// 手动设置signal,防止reqestOptimizer添加可中断的controller
|
||||
signal: globalSettingController.signal,
|
||||
})
|
||||
return result.data || {}
|
||||
return result || {}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch global settings', error)
|
||||
throw error
|
||||
|
||||
Reference in New Issue
Block a user