ソースを参照

修复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 || '',


読み込み中…
キャンセル
保存