From 5d0c88d3a377ad9d5d9f8e3e5e68db009dd74538 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Mon, 13 Jun 2022 06:16:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=9D=A2=E6=9D=BF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=97=B6=E5=9C=A8=E4=B8=80=E4=BA=9B=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E7=9A=84uid=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/character.js b/apps/character.js index 246a671f..9f4744b8 100644 --- a/apps/character.js +++ b/apps/character.js @@ -696,7 +696,13 @@ async function getTargetUid(e) { } } catch (e) { let qq = e.user_id; - uid = await redis.get(`genshin:id-uid:${qq}`) || await Cache.get(`genshin:uid:${qq}`); + if (NoteCookie && NoteCookie[qq]) { + let nc = NoteCookie[qq]; + if (nc.uid && uidReg.test(nc.uid)) { + return nc.uid; + } + } + uid = await redis.get(`genshin:id-uid:${qq}`) || await redis.get(`genshin:uid:${qq}`); if (uid && uidReg.test(uid)) { return uid; } else { @@ -704,7 +710,6 @@ async function getTargetUid(e) { return false; } } - return uid; }