fix: 微信绑定查找wechatUser增加appliaction判断

This commit is contained in:
lxy 2025-12-24 18:09:37 +08:00
parent 1e5697a28e
commit 4227430080
3 changed files with 9 additions and 3 deletions

View File

@ -1745,6 +1745,8 @@ async function loginFromWechatEnv(code, env, context, wechatLoginId) {
},
filter: {
userId: wechatLoginData.userId,
applicationId: application.id,
origin: OriginMap[type],
},
}, {
dontCollect: true,

View File

@ -1771,6 +1771,8 @@ async function loginFromWechatEnv(code, env, context, wechatLoginId) {
},
filter: {
userId: wechatLoginData.userId,
applicationId: application.id,
origin: OriginMap[type],
},
}, {
dontCollect: true,

View File

@ -2136,7 +2136,7 @@ async function loginFromWechatEnv<ED extends EntityDict>(
appSecret!
) as WechatPublicInstance;
const { isSnapshotUser, openId, unionId, ...wechatUserData } = await wechatInstance.code2Session(code);
const { isSnapshotUser, openId, unionId, ...wechatUserData } = await wechatInstance.code2Session(code);
if (isSnapshotUser) {
throw new OakUserException('请使用完整服务后再进行登录操作');
}
@ -2273,6 +2273,8 @@ async function loginFromWechatEnv<ED extends EntityDict>(
},
filter: {
userId: wechatLoginData.userId!,
applicationId: application!.id,
origin: OriginMap[type],
},
},
{
@ -3097,7 +3099,7 @@ export async function sendCaptchaByEmail<ED extends EntityDict>(
}
},
{}
);
);
}
const { code, captchaId } = await getCode();
@ -3369,7 +3371,7 @@ export async function refreshToken<ED extends EntityDict>(
if (!token) {
throw new OakUnloggedInException("Token令牌已失效请重新登录");
}
const now = Date.now();
if (!checkTokenEnvConsistency(env, token.env as WebEnv)) {
console.log('####### refreshToken 环境改变 start #######\n');