fix windows/linux get system uuid error
This commit is contained in:
@@ -128,20 +128,6 @@ export function ConfigProvider({ children }: ConfigProviderProps) {
|
||||
fetchConfig();
|
||||
}, [hasFetched, apiKey]);
|
||||
|
||||
// Check if user has full access
|
||||
useEffect(() => {
|
||||
const checkAccess = async () => {
|
||||
if (config) {
|
||||
const hasFullAccess = await api.checkFullAccess();
|
||||
// Store access level in a global state or context if needed
|
||||
// For now, we'll just log it
|
||||
console.log('User has full access:', hasFullAccess);
|
||||
}
|
||||
};
|
||||
|
||||
checkAccess();
|
||||
}, [config]);
|
||||
|
||||
return (
|
||||
<ConfigContext.Provider value={{ config, setConfig, error }}>
|
||||
{children}
|
||||
|
||||
@@ -140,22 +140,6 @@ class ApiClient {
|
||||
return this.post<Config>('/config', config);
|
||||
}
|
||||
|
||||
// Check if user has full access
|
||||
async checkFullAccess(): Promise<boolean> {
|
||||
try {
|
||||
// Try to access test endpoint (won't actually modify anything)
|
||||
// This will return 403 if user doesn't have full access
|
||||
await this.post<Config>('/config/test', { test: true });
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
if (error.message && error.message.includes('403')) {
|
||||
return false;
|
||||
}
|
||||
// For other errors, assume user has access (to avoid blocking legitimate users)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Get providers
|
||||
async getProviders(): Promise<Provider[]> {
|
||||
return this.get<Provider[]>('/api/providers');
|
||||
|
||||
Reference in New Issue
Block a user