Преглед изворни кода

Merge branch 'master' of http://git.cc-lotus.info/new-live/server-front

guhongwei пре 3 година
родитељ
комит
d8ba1ac299
3 измењених фајлова са 10 додато и 9 уклоњено
  1. 8 7
      app/service/user/admin.js
  2. 1 1
      app/z_router/user/organization.js
  3. 1 1
      app/z_router/user/personal.js

+ 8 - 7
app/service/user/admin.js

@@ -55,13 +55,14 @@ class AdminService extends CrudService {
       throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到上级的信息');
     }
     const res = await this.model.create(data);
-    const icdata = { user_id: res._id, code, user_name: res.name };
-    try {
-      const res = await this.inviteCode.create(icdata);
-    } catch (error) {
-      await this.model.deleteOne({ _id: res._id });
-      throw new BusinessError(ErrorCode.DATABASE_FAULT, '该邀请码已被使用,请重新更换邀请码');
-    }
+    // // 邀请码添加去掉
+    // const icdata = { user_id: res._id, code, user_name: res.name };
+    // try {
+    //   const res = await this.inviteCode.create(icdata);
+    // } catch (error) {
+    //   await this.model.deleteOne({ _id: res._id });
+    //   throw new BusinessError(ErrorCode.DATABASE_FAULT, '该邀请码已被使用,请重新更换邀请码');
+    // }
     return res;
   }
   async delete({ id }) {

+ 1 - 1
app/z_router/user/organization.js

@@ -12,7 +12,7 @@ const routes = [
   { method: 'post', path: `${rkey}/password/:id`, controller: `${ckey}.password`, name: `${ckey}Password`, zh: `${keyZh}修改密码` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
   { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
-  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: ['password'], name: `${ckey}Create`, zh: `创建${keyZh}` },
+  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, name: `${ckey}Create`, zh: `创建${keyZh}` },
   { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
   { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
 ];

+ 1 - 1
app/z_router/user/personal.js

@@ -12,7 +12,7 @@ const routes = [
   { method: 'post', path: `${rkey}/password/:id`, controller: `${ckey}.password`, name: `${ckey}Password`, zh: `${keyZh}修改密码` },
   { method: 'get', path: `${rkey}`, controller: `${ckey}.index`, name: `${ckey}Query`, zh: `${keyZh}列表查询` },
   { method: 'get', path: `${rkey}/:id`, controller: `${ckey}.show`, name: `${ckey}Show`, zh: `${keyZh}查询` },
-  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, middleware: ['password'], name: `${ckey}Create`, zh: `创建${keyZh}` },
+  { method: 'post', path: `${rkey}`, controller: `${ckey}.create`, name: `${ckey}Create`, zh: `创建${keyZh}` },
   { method: 'post', path: `${rkey}/:id`, controller: `${ckey}.update`, name: `${ckey}Update`, zh: `修改${keyZh}` },
   { method: 'delete', path: `${rkey}/:id`, controller: `${ckey}.destroy`, name: `${ckey}Delete`, zh: `删除${keyZh}` },
 ];