mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-03-12 07:58:13 -04:00
parent
58991e3704
commit
9a93314118
@ -142,7 +142,9 @@ export default [
|
||||
action: IRPCActionType.REFRESH_SETTING_WINDOW,
|
||||
handler: async () => {
|
||||
const settingWindow = windowManager.get(IWindowList.SETTING_WINDOW)!
|
||||
settingWindow.webContents.reloadIgnoringCache()
|
||||
settingWindow.webContents.session.clearCache().then(() => {
|
||||
settingWindow.webContents.reloadIgnoringCache()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -165,7 +165,7 @@
|
||||
<el-col :span="22" :offset="1">
|
||||
<el-row :gutter="16">
|
||||
<photo-slider
|
||||
:items="filterList"
|
||||
:items="filterListWithCacheBust"
|
||||
:visible="gallerySliderControl.visible"
|
||||
:index="gallerySliderControl.index"
|
||||
:should-transition="true"
|
||||
@ -186,7 +186,7 @@
|
||||
<div class="gallery-list__item" @click="zoomImage(index)">
|
||||
<img
|
||||
v-lazy="{
|
||||
src: item.galleryPath || item.imgUrl
|
||||
src: addCacheBustParam(item.galleryPath) || addCacheBustParam(item.imgUrl)
|
||||
}"
|
||||
class="gallery-list__item-img"
|
||||
/>
|
||||
@ -432,6 +432,39 @@ const filterList = computed(() => {
|
||||
return res
|
||||
})
|
||||
|
||||
const addCacheBustParam = (url: string | undefined) => {
|
||||
if (!url) {
|
||||
return ''
|
||||
}
|
||||
if (!(url.startsWith('http://') || url.startsWith('https://'))) {
|
||||
return url
|
||||
}
|
||||
try {
|
||||
const separator = url.includes('?') ? '&' : '?'
|
||||
return `${url}${separator}cbplist=${new Date().getTime()}`
|
||||
} catch (e) {
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
||||
const filterListWithCacheBust = computed(() => {
|
||||
const newList = filterList.value.map(item => {
|
||||
const newItem = { ...item }
|
||||
if (newItem.imgUrl) {
|
||||
newItem.imgUrl = addCacheBustParam(newItem.imgUrl)
|
||||
}
|
||||
|
||||
if (newItem.galleryPath) {
|
||||
newItem.galleryPath = addCacheBustParam(newItem.galleryPath)
|
||||
}
|
||||
|
||||
newItem.src = addCacheBustParam(newItem.src || newItem.galleryPath || newItem.imgUrl || '')
|
||||
|
||||
return newItem
|
||||
})
|
||||
return newList
|
||||
})
|
||||
|
||||
const isAllSelected = computed(() => {
|
||||
return Object.values(choosedList).length > 0 && filterList.value.every(item => choosedList[item.id!])
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user