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