浏览代码

修复BUG

master
leiyun 3 周前
父节点
当前提交
8b5d4dafeb
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      src/controller/mp.js

+ 6
- 1
src/controller/mp.js 查看文件

@@ -93,7 +93,12 @@ module.exports = class extends Base {
patient = await this.model('patient')
.field('id, patient_no, name, phone, status, auth_status')
.where({ id: user.patient_id, is_deleted: 0 }).find();
if (think.isEmpty(patient)) patient = null;
if (think.isEmpty(patient)) {
// 关联的患者已被删除,清除关联
await userModel.where({ id: user.id }).update({ patient_id: 0 });
user.patient_id = 0;
patient = null;
}
}
return this.json({ code: 0, data: { token, userInfo: {
id: user.id, nickname: user.nickname || '', avatar: user.avatar || '',


正在加载...
取消
保存