fix: 扫码绑定公众号,code换取相关token需更新wechatUser上

This commit is contained in:
wkj 2025-12-10 10:17:38 +08:00
parent a5f7af8ec1
commit fbfeb210bd
3 changed files with 4 additions and 2 deletions

View File

@ -1745,6 +1745,7 @@ async function loginFromWechatEnv(code, env, context, wechatLoginId) {
action: 'update',
data: {
userId: wechatLoginData.userId,
...wechatUserData
},
filter: {
id: wechatUser.id,

View File

@ -1760,6 +1760,7 @@ async function loginFromWechatEnv(code, env, context, wechatLoginId) {
action: 'update',
data: {
userId: wechatLoginData.userId,
...wechatUserData
},
filter: {
id: wechatUser.id,

View File

@ -2118,8 +2118,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('请使用完整服务后再进行登录操作');
}
@ -2274,6 +2273,7 @@ async function loginFromWechatEnv<ED extends EntityDict>(
action: 'update',
data: {
userId: wechatLoginData.userId!,
...wechatUserData
},
filter: {
id: wechatUser.id,