bugfix: 设置页邮箱&资源下载
This commit is contained in:
@@ -341,7 +341,7 @@ export function useSettingsForm({ t, locale }: UseSettingsFormOptions) {
|
||||
username: draftData.value.username.trim(),
|
||||
email: securityDraft.value.newEmail.trim(),
|
||||
roles: draftData.value.roles as string[],
|
||||
language: backendLanguage, // 发送后端格式:'en' 或 'zh-CN'
|
||||
language: backendLanguage,
|
||||
region: draftData.value.region,
|
||||
newPassword: '',
|
||||
oldPassword: '',
|
||||
@@ -373,7 +373,7 @@ export function useSettingsForm({ t, locale }: UseSettingsFormOptions) {
|
||||
firstName: nextData.firstName,
|
||||
lastName: nextData.lastName,
|
||||
username: nextData.username,
|
||||
email: nextData.email,
|
||||
email: nextData.email || draftData.value.email,
|
||||
roles: nextData.roles as RoleValue[],
|
||||
language: frontendLanguage,
|
||||
region: nextData.region as any
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
class="assets-toolbar__download flex flex-center"
|
||||
:class="{ disabled: selectedCount < 1 }"
|
||||
v-loading="downloadingSelected"
|
||||
@click="handleDownloadSelected"
|
||||
@click="handleDownloadSelected(null)"
|
||||
>
|
||||
<SvgIcon name="downloadBtn" color="#fff" />
|
||||
<span>{{ t('Wardrobe.assets.downloadSelected') }}</span>
|
||||
@@ -67,7 +67,7 @@
|
||||
download
|
||||
:url="item.thumbnailUrl"
|
||||
:name="item.listingName"
|
||||
@download.stop="handleDownloadSelected(item)"
|
||||
@download="handleDownloadSelected(item)"
|
||||
:showPrice="false"
|
||||
></CommodityItem>
|
||||
</div>
|
||||
@@ -323,7 +323,7 @@
|
||||
}
|
||||
|
||||
const downloadingSelected = ref(false)
|
||||
const handleDownloadSelected = (assets) => {
|
||||
const handleDownloadSelected = (assets = null) => {
|
||||
const items = assets ? [assets] : dataList.value.filter((item) => item.checked)
|
||||
|
||||
downloadingSelected.value = true
|
||||
@@ -350,7 +350,8 @@
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Download failed:', error)
|
||||
}).finally(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
downloadingSelected.value = false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -257,7 +257,26 @@
|
||||
}
|
||||
|
||||
const handleDownload = (order) => {
|
||||
console.log(order)
|
||||
const ids = order.items.map((item) => item.id)
|
||||
fetchDownloadItemsByGet({ ids }).then((res) => {
|
||||
console.log(res)
|
||||
const disposition = res.headers['content-disposition']
|
||||
const fileName = disposition?.split('filename=')[1]?.replace(/"/g, '') || 'download.zip'
|
||||
const blob = res.data
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
|
||||
const timestamp = new Date().getTime()
|
||||
link.download = fileName || `wardrobe_download_${timestamp}.zip`
|
||||
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
})
|
||||
}
|
||||
|
||||
const handleRouteBrand = (order: OrderRecord) => {
|
||||
|
||||
Reference in New Issue
Block a user