Browse Source

feat: 下载

luoyali 8 tháng trước cách đây
mục cha
commit
b46af3a4bf
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/api/codeGenerate/database.ts

+ 5 - 1
src/api/codeGenerate/database.ts

@@ -31,7 +31,11 @@ function codePreviewApi(data: any): AxiosPromise {
 function codeDownloadApi(data: any) {
 	const url = import.meta.env.VITE_APP_BASE_API + api.codeDownload + `?t=${new Date().getTime()}`
 	try {
-		const response = axios.post(url, data)
+		const response = axios.post(url, data, {
+			headers: {
+				'Content-Type': 'application/zip'
+			}
+		})
 		return response // 提取数据
 	} catch (error) {
 		console.error('Error downloading code:', error)