Quellcode durchsuchen

个人用户创建时提示修改

lrf vor 3 Jahren
Ursprung
Commit
b470063aed
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      app/service/users/personal.js

+ 2 - 2
app/service/users/personal.js

@@ -22,10 +22,10 @@ class PersonalService extends CrudService {
    */
   async create({ password, ...data }) {
     data.password = { secret: password };
-    const { phone } = data;
+    const { name, phone } = data;
     // 检查手机号
     const num = await this.model.count({ phone, isdel: '0' });
-    if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '已有个人用户使用该手机号');
+    if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, `姓名:${name} ; 手机号: ${phone} ;已有个人用户使用该手机号`);
     return await this.model.create(data);
   }
   /**