update:文件下载配置
This commit is contained in:
@@ -17,8 +17,8 @@ VITE_API_STATIC_FILE=http://192.168.65.161:3000/static
|
|||||||
VITE_API_IMAGE_PREVIEW_URL=http://192.168.65.161:3000/imagePreview
|
VITE_API_IMAGE_PREVIEW_URL=http://192.168.65.161:3000/imagePreview
|
||||||
# 文件预览地址
|
# 文件预览地址
|
||||||
VITE_API_FILE_PREVIEW_URL=http://192.168.65.161:3000/preview/onlinePreview
|
VITE_API_FILE_PREVIEW_URL=http://192.168.65.161:3000/preview/onlinePreview
|
||||||
# 文件下载地址(暂未使用)
|
# 文件下载地址
|
||||||
VITE_API_FILE_URL=http://192.168.65.161:7104
|
VITE_API_DOWNLOAD_URL=http://192.168.65.161:9000
|
||||||
# onlyOffice服务
|
# onlyOffice服务
|
||||||
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
||||||
# onlyOffice回调服务
|
# onlyOffice回调服务
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ VITE_API_STATIC_FILE=http://192.168.65.161:3000/static
|
|||||||
VITE_API_IMAGE_PREVIEW_URL=http://cidweb.eon.com.cn:3000/imagePreview
|
VITE_API_IMAGE_PREVIEW_URL=http://cidweb.eon.com.cn:3000/imagePreview
|
||||||
# 文件预览地址
|
# 文件预览地址
|
||||||
VITE_API_FILE_PREVIEW_URL=http://cidweb.eon.com.cn:3000/preview/onlinePreview
|
VITE_API_FILE_PREVIEW_URL=http://cidweb.eon.com.cn:3000/preview/onlinePreview
|
||||||
# 文件下载地址(暂未使用)
|
# 文件下载地址
|
||||||
VITE_API_FILE_URL=http://192.168.65.161:7104
|
VITE_API_DOWNLOAD_URL=http://cidweb.eon.com.cn:3000
|
||||||
# onlyOffice服务
|
# onlyOffice服务
|
||||||
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
||||||
# onlyOffice回调服务
|
# onlyOffice回调服务
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ VITE_API_STATIC_FILE=http://192.168.30.147:7115/static
|
|||||||
VITE_API_IMAGE_PREVIEW_URL=http://192.168.30.147:7115/imagePreview
|
VITE_API_IMAGE_PREVIEW_URL=http://192.168.30.147:7115/imagePreview
|
||||||
# 文件预览地址
|
# 文件预览地址
|
||||||
VITE_API_FILE_PREVIEW_URL=http://192.168.30.147:7115/preview/onlinePreview
|
VITE_API_FILE_PREVIEW_URL=http://192.168.30.147:7115/preview/onlinePreview
|
||||||
# 文件下载地址(暂未使用)
|
# 文件下载地址
|
||||||
VITE_API_FILE_URL=http://192.168.30.148:7104
|
VITE_API_DOWNLOAD_URL=http://192.168.30.146:9000
|
||||||
# onlyOffice服务
|
# onlyOffice服务
|
||||||
VITE_API_ONLYOFFICE_URL=http://192.168.30.148:18888
|
VITE_API_ONLYOFFICE_URL=http://192.168.30.148:18888
|
||||||
# onlyOffice回调服务
|
# onlyOffice回调服务
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ VITE_API_STATIC_FILE=http://192.168.190.161:3000/static
|
|||||||
VITE_API_IMAGE_PREVIEW_URL=http://192.168.190.161:3000/imagePreview
|
VITE_API_IMAGE_PREVIEW_URL=http://192.168.190.161:3000/imagePreview
|
||||||
# 文件预览地址
|
# 文件预览地址
|
||||||
VITE_API_FILE_PREVIEW_URL=http://192.168.190.161:3000/preview/onlinePreview
|
VITE_API_FILE_PREVIEW_URL=http://192.168.190.161:3000/preview/onlinePreview
|
||||||
# 文件下载地址(暂未使用)
|
# 文件下载地址
|
||||||
VITE_API_FILE_URL=http://192.168.190.161:7104
|
VITE_API_DOWNLOAD_URL=http://192.168.190.161:9000
|
||||||
# onlyOffice服务
|
# onlyOffice服务
|
||||||
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
||||||
# onlyOffice回调服务
|
# onlyOffice回调服务
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ VITE_API_STATIC_FILE=http://192.168.65.161:3000/static
|
|||||||
VITE_API_IMAGE_PREVIEW_URL=http://192.168.65.161:3000/imagePreview
|
VITE_API_IMAGE_PREVIEW_URL=http://192.168.65.161:3000/imagePreview
|
||||||
# 文件预览地址
|
# 文件预览地址
|
||||||
VITE_API_FILE_PREVIEW_URL=http://192.168.65.161:3000/preview/onlinePreview
|
VITE_API_FILE_PREVIEW_URL=http://192.168.65.161:3000/preview/onlinePreview
|
||||||
# 文件下载地址(暂未使用)
|
# 文件下载地址
|
||||||
VITE_API_FILE_URL=http://192.168.65.161:7104
|
VITE_API_DOWNLOAD_URL=http://192.168.65.161:9000
|
||||||
# onlyOffice服务
|
# onlyOffice服务
|
||||||
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
VITE_API_ONLYOFFICE_URL=http://192.168.65.161:18888
|
||||||
# onlyOffice回调服务
|
# onlyOffice回调服务
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ export const exportFile = (api: any, tableName: string, fileName: string, params
|
|||||||
export const downloadFileById = async (fileId: number) => {
|
export const downloadFileById = async (fileId: number) => {
|
||||||
// 1.点击事件下载
|
// 1.点击事件下载
|
||||||
// const link = document.createElement('a');
|
// const link = document.createElement('a');
|
||||||
// link.href = `${env.VITE_API_FILE_URL}/data/downloadFile?fileId=${fileId}`;
|
// link.href = `${env.VITE_API_DOWNLOAD_URL}/data/downloadFile?fileId=${fileId}`;
|
||||||
// document.body.appendChild(link);
|
// document.body.appendChild(link);
|
||||||
// link.click();
|
// link.click();
|
||||||
// document.body.removeChild(link);
|
// document.body.removeChild(link);
|
||||||
@@ -232,7 +232,8 @@ export const downloadFileById = async (fileId: number) => {
|
|||||||
// 3.浏览器下载
|
// 3.浏览器下载
|
||||||
getMinioPresignedUrlApi({ fileId }).then((res: any) => {
|
getMinioPresignedUrlApi({ fileId }).then((res: any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const downloadUrl = res.data.minioDownloadUrl;
|
const { minioDownloadUrl } = res.data;
|
||||||
|
const downloadUrl = env.VITE_API_DOWNLOAD_URL + minioDownloadUrl.split(':9000')[1];
|
||||||
window.open(downloadUrl, '_blank');
|
window.open(downloadUrl, '_blank');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user