fix: 扫码绑定公众号,code换取相关token需更新wechatUser上
This commit is contained in:
parent
a5f7af8ec1
commit
fbfeb210bd
|
|
@ -1745,6 +1745,7 @@ async function loginFromWechatEnv(code, env, context, wechatLoginId) {
|
|||
action: 'update',
|
||||
data: {
|
||||
userId: wechatLoginData.userId,
|
||||
...wechatUserData
|
||||
},
|
||||
filter: {
|
||||
id: wechatUser.id,
|
||||
|
|
|
|||
|
|
@ -1760,6 +1760,7 @@ async function loginFromWechatEnv(code, env, context, wechatLoginId) {
|
|||
action: 'update',
|
||||
data: {
|
||||
userId: wechatLoginData.userId,
|
||||
...wechatUserData
|
||||
},
|
||||
filter: {
|
||||
id: wechatUser.id,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue