style: Update globalSettings injection in multiple components

This commit is contained in:
jxxghp
2024-08-29 08:36:29 +08:00
parent 9d55f8ab24
commit 6ec1bbe1ae
10 changed files with 107 additions and 55 deletions

View File

@@ -37,3 +37,13 @@ api.interceptors.response.use(
)
export default api
export async function fetchGlobalSettings() {
try {
const result: { [key: string]: any } = await api.get('system/env')
return result.data || {}
} catch (error) {
console.error('Failed to fetch global settings', error)
throw error
}
}