Skip to content

Commit

Permalink
fix: 下载提示消失
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxtuneLee committed Apr 5, 2024
1 parent 83c633a commit d36878f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/pages/registerDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CloudDownloadOutlined } from '@ant-design/icons'
import { Button, Empty, message, notification, Skeleton, Space } from 'antd'
import React, { Fragment, useLayoutEffect, useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import { downloadCertificate} from '../../api/public'
import { downloadCertificate } from '../../api/public'
import { getCompetitionInfo, getCompetitionSignInfo, getTeamInfo, getWorkInfo } from '../../api/user'
import TopBar from '../../components/TopBar'
import './index.scss'
Expand Down Expand Up @@ -197,16 +197,16 @@ function RegisterDetail() {
* @param url 文件url
*/
const downloadFile = async (url: string) => {
const loadingKey='downloading'
const loadingKey = 'downloading'
message.loading({
content: '正在下载文件',
duration: 30,
duration: 300000,
key: 'downloading',
})
const res = await downloadCertificate(url)
console.log(res.data);
const response=res.data

const response = res.data
if (response.success) {
const file = await fetch(response.data.url)
const fileBlob = await file.blob()
Expand All @@ -220,7 +220,7 @@ function RegisterDetail() {
document.body.removeChild(a)
URL.revokeObjectURL(urlvalue)
message.success({
content: '😁下载完成!'
content: '😁下载完成!'
})
} else {
message.error({
Expand Down
2 changes: 1 addition & 1 deletion src/pages/reviewApprover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const ReviewApprover: React.FC = (props) => {
const loadingKey = 'downloading'
message.loading({
content: '正在下载文件',
duration: 30,
duration: 300000,
key: 'downloading',
})
const res = await downloadCertificate(url)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/reviewJudge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ReviewJudge: React.FC = (props) => {
const loadingKey = 'downloading'
message.loading({
content: '正在下载文件',
duration: 30,
duration: 300000,
key: 'downloading',
})
const res = await downloadCertificate(url)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function WorkDetail() {
const loadingKey = 'downloading'
message.loading({
content: '正在下载文件',
duration: 30,
duration: 300000,
key: 'downloading',
})
const res = await downloadCertificate(url)
Expand Down

0 comments on commit d36878f

Please sign in to comment.