Skip to content

Commit

Permalink
使用get来下载
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli committed Nov 3, 2024
1 parent 2b7cf00 commit 28cb4b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions webui/src/service/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ export async function GetHeapDumpFile() {
await endpointStore.serverAvailable

const url = new URL(urlJoin(endpointStore.endpoint, 'api/general/heapdump'), location.href)
return fetch(url, { headers: getCommonHeader(), method: 'POST' }).then((res) => {
endpointStore.assertResponseLogin(res)
return res.blob()
})
url.searchParams.set('token', endpointStore.authToken)
return url
}
5 changes: 3 additions & 2 deletions webui/src/views/settings/components/info/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,10 @@ const showLog = ref(false)
const downloadHeap = async () => {
Message.info(t('page.settings.tab.info.downloadHeap'))
const blob = await GetHeapDumpFile()
const url = await GetHeapDumpFile()
const a = document.createElement('a')
a.href = window.URL.createObjectURL(blob)
a.href = url.toString()
a.target = '_blank'
a.download = 'heapdump.hprof.gz'
a.click()
}
Expand Down

0 comments on commit 28cb4b2

Please sign in to comment.