diff --git a/apps/character/AvatarCard.js b/apps/character/AvatarCard.js index 7121b015..618adde8 100644 --- a/apps/character/AvatarCard.js +++ b/apps/character/AvatarCard.js @@ -114,7 +114,7 @@ let Avatar = { if (!Common.cfg('avatarCard')) { return false } - let uidRet = /[0-9]{9}/.exec(msg) + let uidRet = /(18|[1-9])[0-9]{8}/g.exec(msg) if (uidRet) { e.uid = uidRet[0] msg = msg.replace(uidRet[0], '') diff --git a/apps/profile.js b/apps/profile.js index ce7d1237..f7612c38 100644 --- a/apps/profile.js +++ b/apps/profile.js @@ -87,7 +87,7 @@ app.reg({ name: '角色查询', fn: ProfileStat.avatarList, rule: /^#喵喵(角色|查询)[ |0-9]*$/, - yzRule: /^(#(五|四|5|4|星)*(角色|查询|查询角色|角色查询|人物)[ |0-9]*$)|(^(#*uid|#*UID)\+*([1-9]|18)[0-9]{8}$)|(^#[\+|+]*([1-9]|18)[0-9]{8})/, + yzRule: /^(#(五|四|5|4|星)*(角色|查询|查询角色|角色查询|人物)[ |0-9]*$)|(^(#*uid|#*UID)\+*(18|[1-9])[0-9]{8}$)|(^#[\+|+]*(18|[1-9])[0-9]{8})/, yzCheck: () => Cfg.get('avatarList', false) }, diff --git a/apps/profile/ProfileCommon.js b/apps/profile/ProfileCommon.js index a7158712..4657c472 100644 --- a/apps/profile/ProfileCommon.js +++ b/apps/profile/ProfileCommon.js @@ -8,7 +8,7 @@ import { miaoPath } from '#miao.path' * 获取面板查询的 目标uid * */ const _getTargetUid = async function (e) { - let uidReg = /([1-9]|18)[0-9]{8}/ + let uidReg = /(18|[1-9])[0-9]{8}/ if (e.uid && uidReg.test(e.uid)) { return e.uid diff --git a/apps/profile/ProfileDetail.js b/apps/profile/ProfileDetail.js index 37f73295..1fdc9fb3 100644 --- a/apps/profile/ProfileDetail.js +++ b/apps/profile/ProfileDetail.js @@ -42,7 +42,7 @@ let ProfileDetail = { e._profileMsg = changeMsg } } - let uidRet = /[0-9]{9}/.exec(msg) + let uidRet = /(18|[1-9])[0-9]{8}/g.exec(msg) if (uidRet) { e.uid = uidRet[0] msg = msg.replace(uidRet[0], '') diff --git a/models/avatar/ProfileAvatar.js b/models/avatar/ProfileAvatar.js index 649c2991..fc3da81e 100644 --- a/models/avatar/ProfileAvatar.js +++ b/models/avatar/ProfileAvatar.js @@ -18,7 +18,7 @@ const ProfileAvatar = { return false } let { uid, e } = player - if (uid.toString().length !== 9 || !e) { + if (![9, 10].includes(uid.toString().length) || !e) { return false } let ret = await Serv.req(e, player)