diff --git a/src/controllers/mail.controller.ts b/src/controllers/mail.controller.ts index 8edb5af..45f09ac 100644 --- a/src/controllers/mail.controller.ts +++ b/src/controllers/mail.controller.ts @@ -82,7 +82,13 @@ class MailController extends BaseController { } const openId = recordCode.openId let userCheck = await ActivityUser.findOne({ clientId: openId, clientPlat: recordCode.plat }) - if (userCheck && userCheck.id !== user.id) { + let userCheck2 = await ActivityUser.findOne({ googleId: openId }) + let userCheck3 = await ActivityUser.findOne({ emailId: openId }) + if ( + (userCheck && userCheck.id !== user.id) || + (userCheck2 && userCheck2.id !== user.id) || + (userCheck3 && userCheck3.id !== user.id) + ) { throw new ZError(13, 'Email already binded to another account') } user.clientId = openId