guhongwei 5 年 前
コミット
ce73e7c5df
1 ファイル変更1 行追加1 行削除
  1. 1 1
      app/service/user.js

+ 1 - 1
app/service/user.js

@@ -68,7 +68,7 @@ class UserService extends CrudService {
     const user = await this.model.findById(id);
     const user = await this.model.findById(id);
     const { phone, role } = data;
     const { phone, role } = data;
     const phoneList = await this.model.find({ phone, role });
     const phoneList = await this.model.find({ phone, role });
-    const is_has = phoneList.find(f => f.id == id);
+    const is_has = phoneList.find(f => f.id !== id);
     if (is_has) throw new BusinessError('此身份手机号已被注册,请更换手机号');
     if (is_has) throw new BusinessError('此身份手机号已被注册,请更换手机号');
     if (data.name) {
     if (data.name) {
       user.name = data.name;
       user.name = data.name;