File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 11import { attachment , job } from '@/api' ;
2+ import { download } from '@/utils/export' ;
23import { LoadingOutlined } from '@ant-design/icons' ;
34import { findByValue } from '@oceanbase/util' ;
45import { useRequest } from 'ahooks' ;
@@ -35,17 +36,7 @@ export default function DownloadModal({
3536 manual : true ,
3637 onSuccess : ( data ) => {
3738 if ( data ) {
38- // 将File对象转换为Blob进行下载
39- const blob = new Blob ( [ data ] , { type : 'application/octet-stream' } ) ;
40- const url = window . URL . createObjectURL ( blob ) ;
41- const link = document . createElement ( 'a' ) ;
42- link . href = url ;
43- link . download =
44- attachmentValue || `cluster_log_${ new Date ( ) . getTime ( ) } ` ;
45- document . body . appendChild ( link ) ;
46- link . click ( ) ;
47- document . body . removeChild ( link ) ;
48- window . URL . revokeObjectURL ( url ) ;
39+ download ( data , attachmentValue ) ;
4940 message . success ( '文件下载成功' ) ;
5041 } else {
5142 message . error ( '下载数据为空' ) ;
You can’t perform that action at this time.
0 commit comments