Ver Fonte

修改类型

zs há 2 anos atrás
pai
commit
51febb3d7c

+ 5 - 4
src/controller/system/role.controller.ts

@@ -71,10 +71,11 @@ export class RoleController extends BaseController {
     const type = get(user, 'type');
     const user_id = get(this.ctx.user, '_id');
     let udata = {};
-    if (type === '1') udata = await this.adminService.fetch(user_id);
-    else if (type === '3') udata = await this.personalService.fetch(user_id);
-    else if (type === '4') udata = await this.companyService.fetch(user_id);
-    else if (type === '5') udata = await this.expertService.fetch(user_id);
+    if (type === '1' || type === '2' || type === '3')
+      udata = await this.adminService.fetch(user_id);
+    else if (type === '4') udata = await this.personalService.fetch(user_id);
+    else if (type === '5') udata = await this.companyService.fetch(user_id);
+    else if (type === '6') udata = await this.expertService.fetch(user_id);
     else if (type === '0') {
       // 超级管理员
       const f = new SearchBase({});

+ 1 - 1
src/entity/system/menus.entity.ts

@@ -26,7 +26,7 @@ export class Menus extends BaseModel {
   @prop({ required: false, index: false, zh: '设置' })
   config: object;
   @prop({ required: false, index: true, zh: '显示顺序' })
-  sort: string;
+  sort: number;
   @prop({ required: false, index: false, zh: '备注' })
   remark: string;
   @prop({

+ 1 - 1
src/entity/user/company.entity.ts

@@ -5,7 +5,7 @@ import isString = require('lodash/isString');
   schemaOptions: { collection: 'company' },
 })
 export class Company extends BaseModel {
-  @prop({ required: false, index: true, zh: '用户类型', default: '4' })
+  @prop({ required: false, index: true, zh: '用户类型', default: '5' })
   type: string;
   @prop({ required: false, index: true, zh: '邀请码' })
   code: string;

+ 1 - 1
src/entity/user/expert.entity.ts

@@ -5,7 +5,7 @@ import isString = require('lodash/isString');
   schemaOptions: { collection: 'expert' },
 })
 export class Expert extends BaseModel {
-  @prop({ required: false, index: true, zh: '账号类型', default: '5' })
+  @prop({ required: false, index: true, zh: '账号类型', default: '6' })
   type: string;
   @prop({ required: false, index: true, zh: '邀请码' })
   code: string;

+ 1 - 1
src/entity/user/personal.entity.ts

@@ -5,7 +5,7 @@ import isString = require('lodash/isString');
   schemaOptions: { collection: 'personal' },
 })
 export class Personal extends BaseModel {
-  @prop({ required: false, index: false, zh: '用户类型', default: '3' })
+  @prop({ required: false, index: false, zh: '用户类型', default: '4' })
   type: string;
   @prop({ required: false, index: false, zh: '邀请码' })
   code: string;

+ 4 - 4
src/interface/system/menus.interface.ts

@@ -31,7 +31,7 @@ export class FVO_menus {
   @ApiProperty({ description: '设置' })
   'config': object = undefined;
   @ApiProperty({ description: '显示顺序' })
-  'sort': string = undefined;
+  'sort': number = undefined;
   @ApiProperty({ description: '备注' })
   'remark': string = undefined;
   @ApiProperty({ description: '是否使用' })
@@ -70,7 +70,7 @@ export class QDTO_menus extends SearchBase {
   @ApiProperty({ description: '图标' })
   'icon': string = undefined;
   @ApiProperty({ description: '显示顺序' })
-  'sort': string = undefined;
+  'sort': number = undefined;
   @ApiProperty({ description: '是否使用' })
   'is_use': string = undefined;
 }
@@ -108,8 +108,8 @@ export class CDTO_menus {
   @Rule(RuleType['object']().empty(''))
   'config': object = undefined;
   @ApiProperty({ description: '显示顺序' })
-  @Rule(RuleType['string']().empty(''))
-  'sort': string = undefined;
+  @Rule(RuleType['number']().empty(''))
+  'sort': number = undefined;
   @ApiProperty({ description: '备注' })
   @Rule(RuleType['string']().empty(''))
   'remark': string = undefined;

+ 1 - 1
src/interface/user/company.interface.ts

@@ -234,7 +234,7 @@ export class LoginVO {
     for (const key of Object.keys(this)) {
       this[key] = get(data, key);
     }
-    this.type = '4';
+    this.type = '5';
   }
   @ApiProperty({ description: '数据id' })
   _id: string = undefined;

+ 1 - 1
src/interface/user/expert.interface.ts

@@ -222,7 +222,7 @@ export class LoginVO {
     for (const key of Object.keys(this)) {
       this[key] = get(data, key);
     }
-    this.type = '5';
+    this.type = '6';
   }
   @ApiProperty({ description: '数据id' })
   _id: string = undefined;

+ 1 - 1
src/interface/user/personal.interface.ts

@@ -188,7 +188,7 @@ export class LoginVO {
     for (const key of Object.keys(this)) {
       this[key] = get(data, key);
     }
-    this.type = '3';
+    this.type = '4';
   }
   @ApiProperty({ description: '数据id' })
   _id: string = undefined;