fix windows/linux get system uuid error

This commit is contained in:
musistudio
2025-08-12 21:41:42 +08:00
parent 075ec76ec1
commit cce1625534
7 changed files with 43 additions and 216 deletions

View File

@@ -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}

View File

@@ -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');