fix: resolve SVG loading error and improve TypeScript typing
- Fix EntityIcon.vue to import blank-square.svg as module instead of using relative path - Update template to use imported SVG path for proper Electron compatibility - Make contact prop optional in EntityIcon component to fix TypeScript error - Add proper Settings type imports and method signatures in PlatformServiceMixin.ts - Replace console statements with logger calls across multiple files - Resolves SVG loading failures in Electron builds while maintaining web compatibility - Reduces TypeScript 'any' type warnings from 81 to 53
This commit is contained in:
@@ -101,6 +101,29 @@ export async function createBuildConfig(mode: string): Promise<UserConfig> {
|
||||
console.log('[Image Proxy Response]', req.url, '->', proxyRes.statusCode, proxyRes.headers.location || 'no redirect');
|
||||
});
|
||||
}
|
||||
},
|
||||
// Proxy Flickr images to avoid CORS issues
|
||||
'/flickr-proxy': {
|
||||
target: 'https://live.staticflickr.com',
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
followRedirects: true,
|
||||
rewrite: (path) => path.replace(/^\/flickr-proxy/, ''),
|
||||
configure: (proxy) => {
|
||||
proxy.on('error', (err, req, res) => {
|
||||
console.log('[Flickr Proxy Error]', err);
|
||||
});
|
||||
proxy.on('proxyReq', (proxyReq, req, res) => {
|
||||
console.log('[Flickr Proxy Request]', req.method, req.url, '->', proxyReq.path);
|
||||
});
|
||||
proxy.on('proxyRes', (proxyRes, req, res) => {
|
||||
// Add CORS headers to the response
|
||||
proxyRes.headers['Access-Control-Allow-Origin'] = '*';
|
||||
proxyRes.headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS';
|
||||
proxyRes.headers['Access-Control-Allow-Headers'] = 'Content-Type';
|
||||
console.log('[Flickr Proxy Response]', req.url, '->', proxyRes.statusCode);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user