mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 12:42:51 +00:00
fix: 桌面端查看表情图片缩略图显示错误
This commit is contained in:
parent
23188777fe
commit
008653e3d9
@ -37,13 +37,16 @@
|
|||||||
const {ipcRenderer} = require('electron');
|
const {ipcRenderer} = require('electron');
|
||||||
|
|
||||||
const thumbnailUrl = (url) => {
|
const thumbnailUrl = (url) => {
|
||||||
|
url = `${url}`
|
||||||
|
.replace(/_thumb\.(png|jpg|jpeg)$/, '')
|
||||||
|
.replace(/\/crop\/([^\/]+)$/, '')
|
||||||
|
if (!/^https?:\/\/[^\/]+\/uploads\//.test(url)) {
|
||||||
|
return url
|
||||||
|
}
|
||||||
const crops = {
|
const crops = {
|
||||||
ratio: 3,
|
ratio: 3,
|
||||||
percentage: '320x0'
|
percentage: '320x0'
|
||||||
}
|
}
|
||||||
url = `${url}`
|
|
||||||
.replace(/_thumb\.(png|jpg|jpeg)$/, '')
|
|
||||||
.replace(/\/crop\/([^\/]+)$/, '')
|
|
||||||
return url + "/crop/" + Object.keys(crops).map(key => {
|
return url + "/crop/" + Object.keys(crops).map(key => {
|
||||||
return `${key}:${crops[key]}`
|
return `${key}:${crops[key]}`
|
||||||
}).join(",")
|
}).join(",")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user