feat: 下载page到本地

This commit is contained in:
2024-10-08 17:10:32 +08:00
parent 54e3ccb3ff
commit 8cdd54af04
9 changed files with 361 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ export const getContentType = (filePath: string) => {
'.html': 'text/html',
'.js': 'text/javascript',
'.css': 'text/css',
'.txt': 'text/plain',
'.json': 'application/json',
'.png': 'image/png',
'.jpg': 'image/jpg',
@@ -13,6 +14,7 @@ export const getContentType = (filePath: string) => {
'.svg': 'image/svg+xml',
'.wav': 'audio/wav',
'.mp4': 'video/mp4',
'.zip': 'application/octet-stream',
};
return contentType[extname] || 'application/octet-stream';
};