Skip to content

Commit 9da690f

Browse files
committed
dev
1 parent cb4b603 commit 9da690f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/custom_model/custom_model.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: chan-max [email protected]
33
* @Date: 2025-06-02 17:58:18
44
* @LastEditors: chan-max [email protected]
5-
* @LastEditTime: 2025-06-13 00:34:48
5+
* @LastEditTime: 2025-07-08 20:18:09
66
* @FilePath: /design-server/src/custom_model/custom_model.service.ts
77
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
88
*/
@@ -59,6 +59,10 @@ export class CustomModelService extends BasicService {
5959

6060
async update(post) {
6161
const item = await this.customModelRepository.findOne(post.id);
62+
// 如果缩略图有变化,且原来有缩略图,先删除旧的
63+
if (post.thumbnail && item.thumbnail && post.thumbnail !== item.thumbnail) {
64+
await this.cosService.deleteFile(item.thumbnail);
65+
}
6266
Object.assign(item, post);
6367
return this.customModelRepository.save(item);
6468
}

0 commit comments

Comments
 (0)