🐛 修复动图渲染异常

This commit is contained in:
目棃
2024-02-25 00:16:08 +08:00
parent 2509b488d2
commit 553c1e1bba
2 changed files with 6 additions and 8 deletions

View File

@@ -62,6 +62,7 @@ function getImageTitle(): string {
function getImageUrl(): string {
const img = props.data.insert.image;
const append = "?x-oss-process=image/format,png";
if (img.endsWith(".gif")) return img;
return img + append;
}
</script>

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Mys/utils/news.ts
* @description Mys 插件咨讯工具
* @since Beta v0.4.0
* @since Beta v0.4.4
*/
/**
@@ -53,7 +53,7 @@ export function getActivityStatus(status: number): TGApp.Plugins.Mys.News.Render
/**
* @description 获取封面图
* @since Beta v0.4.0
* @since Beta v0.4.4
* @param {TGApp.Plugins.Mys.News.Item} item 咨讯列表项
* @returns {string} 封面图链接
*/
@@ -68,12 +68,9 @@ export function getPostCover(item: TGApp.Plugins.Mys.News.Item): string {
} else if (item.post.images.length > 0) {
cover = item.post.images[0];
}
if (cover === undefined) {
cover = defaultCover;
} else {
cover = `${cover}?x-oss-process=image/format,png`;
}
return cover;
if (cover === undefined) return defaultCover;
if (cover.endsWith(".gif")) return cover;
return `${cover}?x-oss-process=image/format,png`;
}
/**