|
@@ -118,7 +118,12 @@ class UserService extends CrudService {
|
|
|
if (user) {
|
|
|
// 2021-06-07修改:根据身份证/手机号,找到对应的学生信息,将_id变为uid重保存
|
|
|
const stuInfo = await this.stuModel.findOne({ $or: [{ id_number }, { mobile }] });
|
|
|
- if (stuInfo) user.uid = stuInfo._id;
|
|
|
+ if (stuInfo) {
|
|
|
+ user.uid = stuInfo._id;
|
|
|
+ // 将学生信息的openid也重置
|
|
|
+ stuInfo.openid = openid;
|
|
|
+ await stuInfo.save();
|
|
|
+ }
|
|
|
user.openid = openid;
|
|
|
user.unionid = unionid;
|
|
|
await user.save();
|