From 54da8be2e766debba115f7a4885f811ee2030ab0 Mon Sep 17 00:00:00 2001 From: story-x <394890254@qq.com> Date: Tue, 14 May 2024 09:38:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=EF=BC=9A=20=E6=98=9F=E9=93=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81face-q?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/character/CharImg.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/models/character/CharImg.js b/models/character/CharImg.js index 475ceccb..e4153c01 100644 --- a/models/character/CharImg.js +++ b/models/character/CharImg.js @@ -128,10 +128,15 @@ const CharImg = { let fileType = 'webp' const nPath = `/meta-sr/character/${name}/` let imgs = {} - let add = (key, path) => { - imgs[key] = `${nPath}${path}.${fileType}` + let add = (key, path, path2) => { + if (path2 && fs.existsSync(`${rPath}/${nPath}/${path2}.${fileType}`)) { + imgs[key] = `${nPath}${path2}.${fileType}` + } else { + imgs[key] = `${nPath}${path}.${fileType}` + } } add('face', 'imgs/face') + add('qFace', 'imgs/face', 'imgs/face-q') add('splash', 'imgs/splash') add('preview', 'imgs/preview') for (let i = 1; i <= 3; i++) {