瀏覽代碼

个人用户创建时提示修改

lrf 3 年之前
父節點
當前提交
b470063aed
共有 1 個文件被更改,包括 2 次插入2 次删除
  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 }) {
   async create({ password, ...data }) {
     data.password = { secret: password };
     data.password = { secret: password };
-    const { phone } = data;
+    const { name, phone } = data;
     // 检查手机号
     // 检查手机号
     const num = await this.model.count({ phone, isdel: '0' });
     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);
     return await this.model.create(data);
   }
   }
   /**
   /**