Browse Source

Merge branch 'main' of http://git.cc-lotus.info/Information/cxyy-service into main

zs 11 months ago
parent
commit
5fe63e7092
44 changed files with 191 additions and 150 deletions
  1. 1 1
      src/config/config.self.ts
  2. 2 1
      src/configuration.ts
  3. 1 1
      src/controller/home.controller.ts
  4. 5 4
      src/controller/login.controller.ts
  5. 5 4
      src/controller/platform/achievement.controller.ts
  6. 5 4
      src/controller/platform/collection.controller.ts
  7. 5 4
      src/controller/platform/demand.controller.ts
  8. 5 4
      src/controller/platform/design.controller.ts
  9. 5 4
      src/controller/platform/match.controller.ts
  10. 6 5
      src/controller/platform/news.controller.ts
  11. 5 4
      src/controller/platform/project.controller.ts
  12. 6 4
      src/controller/platform/sign.controller.ts
  13. 5 4
      src/controller/platform/supply.controller.ts
  14. 6 4
      src/controller/platform/tags.controller.ts
  15. 5 5
      src/controller/system/admin.controller.ts
  16. 5 5
      src/controller/system/dictData.controller.ts
  17. 5 5
      src/controller/system/dictType.controller.ts
  18. 5 5
      src/controller/system/menus.controller.ts
  19. 5 5
      src/controller/system/role.controller.ts
  20. 5 5
      src/controller/system/user.controller.ts
  21. 5 4
      src/controller/users/association.controller.ts
  22. 5 4
      src/controller/users/company.controller.ts
  23. 6 5
      src/controller/users/competition.controller.ts
  24. 5 4
      src/controller/users/expert.controller.ts
  25. 5 4
      src/controller/users/incubator.controller.ts
  26. 5 4
      src/controller/users/investment.controller.ts
  27. 5 4
      src/controller/users/state.controller.ts
  28. 5 4
      src/controller/users/unit.controller.ts
  29. 2 1
      src/entity/platform/achievement.entity.ts
  30. 2 2
      src/entity/platform/chat.entity.ts
  31. 2 2
      src/entity/platform/collection.entity.ts
  32. 2 2
      src/entity/platform/news.entity.ts
  33. 1 1
      src/entity/platform/tags.entity.ts
  34. 1 1
      src/entity/system/dept.entity.ts
  35. 4 4
      src/entity/system/menus.entity.ts
  36. 1 1
      src/entity/system/role.entity.ts
  37. 2 2
      src/entity/users/company.entity.ts
  38. 2 2
      src/entityLogs/opera.entity.ts
  39. 16 0
      src/filter/defaultError.filter.ts
  40. 2 2
      src/interface/platform/tags.interface.ts
  41. 10 10
      src/interface/system/menus.interface.ts
  42. 2 2
      src/interface/system/role.interface.ts
  43. 1 1
      src/service/login.service.ts
  44. 8 6
      src/service/system/role.service.ts

+ 1 - 1
src/config/config.self.ts

@@ -63,7 +63,7 @@ export default {
         port: 54321,
         entities: ['./entityLogs'],
         type: 'postgres',
-        synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
+        synchronize: true, // 如果第一次使用,不存在表,有同步的需求可以写 true,注意会丢数据
         logging: false,
       },
     },

+ 2 - 1
src/configuration.ts

@@ -9,6 +9,7 @@ import * as swagger from '@midwayjs/swagger';
 import * as redis from '@midwayjs/redis';
 import * as orm from '@midwayjs/typeorm';
 import { CustomErrorFilter } from './filter/customError.filter';
+import { DefaultErrorFilter } from './filter/defaultError.filter';
 import { CheckTokenMiddleware } from './middleware/checkToken.middleware';
 import { ResponseMiddleware } from './middleware/response.middleware';
 @Configuration({
@@ -37,7 +38,7 @@ export class MainConfiguration {
     // add middleware
     this.app.useMiddleware([ReportMiddleware, CheckTokenMiddleware, ResponseMiddleware]);
     // add filter
-    this.app.useFilter([CustomErrorFilter]);
+    this.app.useFilter([CustomErrorFilter, DefaultErrorFilter]);
     // this.app.useFilter([NotFoundFilter, DefaultErrorFilter]);
   }
 }

+ 1 - 1
src/controller/home.controller.ts

@@ -8,7 +8,7 @@ export class HomeController {
   @Get('/')
   async home(): Promise<string> {
     // const result: any = await this.adminService.create();
-    await this.service.initData();
+    // await this.service.initData();
     return 'starting...';
   }
   // @Get('/:method')

+ 5 - 4
src/controller/login.controller.ts

@@ -28,10 +28,11 @@ export class LoginController {
    * @param data 用户名和密码
    * @param type 用户类型
    */
-  @Post('/:type')
+  @Post('/:type', { routerName: '登录' })
   async toLogin(@Body() data: LoginDTO, @Param('type') type: string) {
     const user = await this.loginService.loginByAccount(data, LoginType[type]);
-    // if (type === 'Admin') user.role = [type];
+    // 超级管理员不需要设置角色,部门,直接给
+    if (type === 'Admin' && user.is_super === '0') user.role = [type];
     let vo = new LoginVO(user);
     vo = JSON.parse(JSON.stringify(vo));
     vo.login_code = await this.loginService.onePointLogin(vo);
@@ -59,13 +60,13 @@ export class LoginController {
    * @param data 修改密码所需数据
    * @param type 账户类型
    */
-  @Post('/updatePwd/:type')
+  @Post('/updatePwd/:type', { routerName: '修改密码' })
   async updatePwd(@Body() data: UPwdDTO, @Param('type') type: string) {
     await this.loginService.updatePwd(data, LoginType[type]);
     return 'ok';
   }
 
-  @Post('/resetPwd/:type')
+  @Post('/resetPwd/:type', { routerName: '重置密码' })
   async resetPwd(@Body('id') id: number, @Param('type') type: string) {
     // 随机密码
     const data = new UPwdDTO();

+ 5 - 4
src/controller/platform/achievement.controller.ts

@@ -7,8 +7,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { omit, pick } from 'lodash';
 import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayjs/core';
 import { Context } from '@midwayjs/koa';
+const namePrefix = '成果';
 @ApiTags(['成果'])
-@Controller('/achievement')
+@Controller('/achievement', { tagName: namePrefix })
 export class AchievementController implements BaseController {
   @Inject()
   service: AchievementService;
@@ -38,7 +39,7 @@ export class AchievementController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_achievement })
@@ -48,7 +49,7 @@ export class AchievementController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_achievement })
@@ -58,7 +59,7 @@ export class AchievementController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/platform/collection.controller.ts

@@ -6,8 +6,9 @@ import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayj
 import { omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
+const namePrefix = '收藏';
 @ApiTags(['收藏'])
-@Controller('/collection')
+@Controller('/collection', { tagName: namePrefix })
 export class CollectionController implements BaseController {
   @Inject()
   service: CollectionService;
@@ -34,7 +35,7 @@ export class CollectionController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_collection })
@@ -44,7 +45,7 @@ export class CollectionController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_collection })
@@ -54,7 +55,7 @@ export class CollectionController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/platform/demand.controller.ts

@@ -7,8 +7,9 @@ import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayj
 import { omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { Context } from '@midwayjs/koa';
+const namePrefix = '需求';
 @ApiTags(['需求'])
-@Controller('/demand')
+@Controller('/demand', { tagName: namePrefix })
 export class DemandController implements BaseController {
   @Inject()
   service: DemandService;
@@ -37,7 +38,7 @@ export class DemandController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_demand })
@@ -47,7 +48,7 @@ export class DemandController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_demand })
@@ -57,7 +58,7 @@ export class DemandController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/platform/design.controller.ts

@@ -6,8 +6,9 @@ import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayj
 import { omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
+const namePrefix = '平台设置';
 @ApiTags(['平台设置'])
-@Controller('/design')
+@Controller('/design', { tagName: namePrefix })
 export class DesignController implements BaseController {
   @Inject()
   service: DesignService;
@@ -34,7 +35,7 @@ export class DesignController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_design })
@@ -44,7 +45,7 @@ export class DesignController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_design })
@@ -54,7 +55,7 @@ export class DesignController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/platform/match.controller.ts

@@ -6,8 +6,9 @@ import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayj
 import { omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
+const namePrefix = '创新大赛';
 @ApiTags(['创新大赛'])
-@Controller('/match')
+@Controller('/match', { tagName: namePrefix })
 export class MatchController implements BaseController {
   @Inject()
   service: MatchService;
@@ -34,7 +35,7 @@ export class MatchController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_match })
@@ -44,7 +45,7 @@ export class MatchController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_match })
@@ -54,7 +55,7 @@ export class MatchController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 6 - 5
src/controller/platform/news.controller.ts

@@ -6,8 +6,9 @@ import { omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayjs/core';
 import { BaseController } from '../../frame/BaseController';
-@ApiTags(['新闻'])
-@Controller('/news')
+const namePrefix = '收藏';
+@ApiTags(['收藏'])
+@Controller('/news', { tagName: namePrefix })
 export class NewsController implements BaseController {
   @Inject()
   service: NewsService;
@@ -35,7 +36,7 @@ export class NewsController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_news })
@@ -45,7 +46,7 @@ export class NewsController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_news })
@@ -55,7 +56,7 @@ export class NewsController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/platform/project.controller.ts

@@ -7,8 +7,9 @@ import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
 import { QVO_project, FVO_project, CVO_project, UVAO_project } from '../../interface/platform/project.interface';
 import { Context } from '@midwayjs/koa';
+const namePrefix = '项目';
 @ApiTags(['项目'])
-@Controller('/project')
+@Controller('/project', { tagName: namePrefix })
 export class ProjectController implements BaseController {
   @Inject()
   service: ProjectService;
@@ -37,7 +38,7 @@ export class ProjectController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_project })
@@ -47,7 +48,7 @@ export class ProjectController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_project })
@@ -57,7 +58,7 @@ export class ProjectController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 6 - 4
src/controller/platform/sign.controller.ts

@@ -6,8 +6,10 @@ import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayj
 import { omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
+const namePrefix = '赛事报名表';
+
 @ApiTags(['赛事报名表'])
-@Controller('/sign')
+@Controller('/sign', { tagName: namePrefix })
 export class SignController implements BaseController {
   @Inject()
   service: SignService;
@@ -34,7 +36,7 @@ export class SignController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_sign })
@@ -44,7 +46,7 @@ export class SignController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_sign })
@@ -54,7 +56,7 @@ export class SignController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/platform/supply.controller.ts

@@ -7,8 +7,9 @@ import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
 import { QVO_supply, FVO_supply, CVO_supply, UVAO_supply } from '../../interface/platform/supply.interface';
 import { Context } from '@midwayjs/koa';
+const namePrefix = '供给';
 @ApiTags(['供给'])
-@Controller('/supply')
+@Controller('/supply', { tagName: namePrefix })
 export class SupplyController implements BaseController {
   @Inject()
   service: SupplyService;
@@ -37,7 +38,7 @@ export class SupplyController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_supply })
@@ -47,7 +48,7 @@ export class SupplyController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_supply })
@@ -57,7 +58,7 @@ export class SupplyController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 6 - 4
src/controller/platform/tags.controller.ts

@@ -6,8 +6,10 @@ import { omit, pick } from 'lodash';
 import { BaseController } from '../../frame/BaseController';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { QVO_tags, FVO_tags, CVO_tags, UVAO_tags } from '../../interface/platform/tags.interface';
+const namePrefix = '标签';
+
 @ApiTags(['标签'])
-@Controller('/tags')
+@Controller('/tags', { tagName: namePrefix })
 export class TagsController implements BaseController {
   @Inject()
   service: TagsService;
@@ -34,7 +36,7 @@ export class TagsController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_tags })
@@ -44,7 +46,7 @@ export class TagsController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_tags })
@@ -54,7 +56,7 @@ export class TagsController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 5
src/controller/system/admin.controller.ts

@@ -6,9 +6,9 @@ import { BaseController } from '../../frame/BaseController';
 import { ErrorCode, ServiceError } from '../../error/service.error';
 import { Validate } from '@midwayjs/validate';
 import { CVO_admin, FVO_admin, QVO_admin, UVAO_admin } from '../../interface/system/admin.interface';
-
+const namePrefix = '管理用户';
 @ApiTags(['管理用户表'])
-@Controller('/admin')
+@Controller('/admin', { tagName: namePrefix })
 export class HomeController implements BaseController {
   controllerCode = 'user_admin';
   @Inject()
@@ -34,7 +34,7 @@ export class HomeController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_admin })
@@ -43,7 +43,7 @@ export class HomeController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_admin })
@@ -53,7 +53,7 @@ export class HomeController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 5
src/controller/system/dictData.controller.ts

@@ -6,9 +6,9 @@ import { omit, pick } from 'lodash';
 import { ErrorCode, ServiceError } from '../../error/service.error';
 import { CVO_dictData, FVO_dictData, QVO_dictData, UVAO_dictData } from '../../interface/system/dictData.interface';
 import { DictDataService } from '../../service/system/dictData.service';
-
+const namePrefix = '字典数据';
 @ApiTags(['字典数据表'])
-@Controller('/dictData')
+@Controller('/dictData', { tagName: namePrefix })
 export class DictDataController implements BaseController {
   controllerCode = 'system_dict';
   @Inject()
@@ -36,7 +36,7 @@ export class DictDataController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_dictData })
@@ -46,7 +46,7 @@ export class DictDataController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_dictData })
@@ -56,7 +56,7 @@ export class DictDataController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 5
src/controller/system/dictType.controller.ts

@@ -6,9 +6,9 @@ import { Validate } from '@midwayjs/validate';
 import { omit, pick } from 'lodash';
 import { ErrorCode, ServiceError } from '../../error/service.error';
 import { CVO_dictType, FVO_dictType, QVO_dictType, UVAO_dictType } from '../../interface/system/dictType.interface';
-
+const namePrefix = '字典类型';
 @ApiTags(['字典类型表'])
-@Controller('/dictType')
+@Controller('/dictType', { tagName: namePrefix })
 export class DictTypeController implements BaseController {
   controllerCode = 'system_dict';
   @Inject()
@@ -36,7 +36,7 @@ export class DictTypeController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_dictType })
@@ -46,7 +46,7 @@ export class DictTypeController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_dictType })
@@ -56,7 +56,7 @@ export class DictTypeController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 5
src/controller/system/menus.controller.ts

@@ -6,9 +6,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { Validate } from '@midwayjs/validate';
 import { MenusService } from '../../service/system/menus.service';
 import { CVO_menus, FVO_menus, QVO_menus, UVAO_menus } from '../../interface/system/menus.interface';
-
+const namePrefix = '目录';
 @ApiTags(['菜单表'])
-@Controller('/menus')
+@Controller('/menus', { tagName: namePrefix })
 export class MenusController implements BaseController {
   controllerCode = 'system_menus';
   @Inject()
@@ -34,7 +34,7 @@ export class MenusController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_menus })
@@ -43,7 +43,7 @@ export class MenusController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_menus })
@@ -53,7 +53,7 @@ export class MenusController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

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

@@ -7,9 +7,9 @@ import { Validate } from '@midwayjs/validate';
 import { RoleService } from '../../service/system/role.service';
 import { CVO_role, FVO_role, QVO_role, UVAO_role } from '../../interface/system/role.interface';
 import { MenusService } from '../../service/system/menus.service';
-
+const namePrefix = '角色';
 @ApiTags(['角色表'])
-@Controller('/role')
+@Controller('/role', { tagName: namePrefix })
 export class RoleController implements BaseController {
   controllerCode = 'system_role';
   @Inject()
@@ -43,7 +43,7 @@ export class RoleController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_role })
@@ -53,7 +53,7 @@ export class RoleController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_role })
@@ -63,7 +63,7 @@ export class RoleController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 5
src/controller/system/user.controller.ts

@@ -6,9 +6,9 @@ import { omit, pick } from 'lodash';
 import { ErrorCode, ServiceError } from '../../error/service.error';
 import { UserService } from '../../service/system/user.service';
 import { CVO_user, FVO_user, QVO_user, UVAO_user } from '../../interface/system/user.interface';
-
+const namePrefix = '平台用户';
 @ApiTags(['平台用户'])
-@Controller('/user')
+@Controller('/user', { tagName: namePrefix })
 export class UserController implements BaseController {
   controllerCode = 'user_user';
   @Inject()
@@ -44,7 +44,7 @@ export class UserController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_user })
@@ -54,7 +54,7 @@ export class UserController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_user })
@@ -64,7 +64,7 @@ export class UserController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/association.controller.ts

@@ -7,8 +7,9 @@ import { UtilService } from '../../service/util.service';
 import { BaseController } from '../../frame/BaseController';
 import { omit, pick } from 'lodash';
 import { ErrorCode, ServiceError } from '../../error/service.error';
+const namePrefix = '商协会';
 @ApiTags(['商协会'])
-@Controller('/association')
+@Controller('/association', { tagName: namePrefix })
 export class AssociationController implements BaseController {
   @Inject()
   service: AssociationService;
@@ -38,7 +39,7 @@ export class AssociationController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_association })
@@ -48,7 +49,7 @@ export class AssociationController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_association })
@@ -59,7 +60,7 @@ export class AssociationController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/company.controller.ts

@@ -8,8 +8,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { CompanyService } from '../../service/users/company.service';
 import { CVO_company, FVO_company, QVO_company, UVAO_company } from '../../interface/users/company.interface';
 import { Context } from '@midwayjs/koa';
+const namePrefix = '企业';
 @ApiTags(['企业'])
-@Controller('/company')
+@Controller('/company', { tagName: namePrefix })
 export class CompanyController implements BaseController {
   @Inject()
   service: CompanyService;
@@ -56,7 +57,7 @@ export class CompanyController implements BaseController {
     return data;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_company })
@@ -66,7 +67,7 @@ export class CompanyController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_company })
@@ -77,7 +78,7 @@ export class CompanyController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 6 - 5
src/controller/users/competition.controller.ts

@@ -7,8 +7,9 @@ import { omit, pick } from 'lodash';
 import { ErrorCode, ServiceError } from '../../error/service.error';
 import { CompetitionService } from '../../service/users/competition.service';
 import { CVO_competition, FVO_competition, QVO_competition, UVAO_competition } from '../../interface/users/competition.interface';
-@ApiTags(['创业大赛'])
-@Controller('/competition')
+const namePrefix = '创新大赛管理人';
+@ApiTags(['创新大赛管理人'])
+@Controller('/competition', { tagName: namePrefix })
 export class CompetitionController implements BaseController {
   @Inject()
   service: CompetitionService;
@@ -38,7 +39,7 @@ export class CompetitionController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_competition })
@@ -48,7 +49,7 @@ export class CompetitionController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_competition })
@@ -59,7 +60,7 @@ export class CompetitionController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/expert.controller.ts

@@ -8,8 +8,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { ExpertService } from '../../service/users/expert.service';
 import { Context } from '@midwayjs/koa';
 import { QVO_expert, FVO_expert, CVO_expert, UVAO_expert } from '../../interface/users/expert.interface';
+const namePrefix = '专家';
 @ApiTags(['专家'])
-@Controller('/expert')
+@Controller('/expert', { tagName: namePrefix })
 export class ExpertController implements BaseController {
   @Inject()
   service: ExpertService;
@@ -54,7 +55,7 @@ export class ExpertController implements BaseController {
     return data;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_expert })
@@ -64,7 +65,7 @@ export class ExpertController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_expert })
@@ -75,7 +76,7 @@ export class ExpertController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/incubator.controller.ts

@@ -8,8 +8,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { Context } from '@midwayjs/koa';
 import { IncubatorService } from '../../service/users/incubator.service';
 import { QVO_incubator, FVO_incubator, CVO_incubator, UVAO_incubator } from '../../interface/users/incubator.interface';
+const namePrefix = '孵化器';
 @ApiTags(['孵化器'])
-@Controller('/incubator')
+@Controller('/incubator', { tagName: namePrefix })
 export class IncubatorController implements BaseController {
   @Inject()
   service: IncubatorService;
@@ -41,7 +42,7 @@ export class IncubatorController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_incubator })
@@ -51,7 +52,7 @@ export class IncubatorController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_incubator })
@@ -62,7 +63,7 @@ export class IncubatorController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/investment.controller.ts

@@ -8,8 +8,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { Context } from '@midwayjs/koa';
 import { InvestmentService } from '../../service/users/investment.service';
 import { QVO_investment, FVO_investment, CVO_investment, UVAO_investment } from '../../interface/users/investment.interface';
+const namePrefix = '投资人';
 @ApiTags(['投资人'])
-@Controller('/investment')
+@Controller('/investment', { tagName: namePrefix })
 export class InvestmentController implements BaseController {
   @Inject()
   service: InvestmentService;
@@ -41,7 +42,7 @@ export class InvestmentController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_investment })
@@ -51,7 +52,7 @@ export class InvestmentController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_investment })
@@ -62,7 +63,7 @@ export class InvestmentController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/state.controller.ts

@@ -8,8 +8,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { Context } from '@midwayjs/koa';
 import { InvestmentService } from '../../service/users/investment.service';
 import { QVO_state, FVO_state, CVO_state, UVAO_state } from '../../interface/users/state.interface';
+const namePrefix = '政府部门';
 @ApiTags(['政府部门'])
-@Controller('/state')
+@Controller('/state', { tagName: namePrefix })
 export class StateController implements BaseController {
   @Inject()
   service: InvestmentService;
@@ -41,7 +42,7 @@ export class StateController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_state })
@@ -51,7 +52,7 @@ export class StateController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_state })
@@ -62,7 +63,7 @@ export class StateController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 5 - 4
src/controller/users/unit.controller.ts

@@ -8,8 +8,9 @@ import { ErrorCode, ServiceError } from '../../error/service.error';
 import { Context } from '@midwayjs/koa';
 import { UnitService } from '../../service/users/unit.service';
 import { QVO_unit, FVO_unit, CVO_unit, UVAO_unit } from '../../interface/users/unit.interface';
+const namePrefix = '科研机构';
 @ApiTags(['科研机构'])
-@Controller('/unit')
+@Controller('/unit', { tagName: namePrefix })
 export class UnitController implements BaseController {
   @Inject()
   service: UnitService;
@@ -41,7 +42,7 @@ export class UnitController implements BaseController {
     return result;
   }
 
-  @Post('/')
+  @Post('/', { routerName: `创建${namePrefix}` })
   @ApiTags('创建数据')
   @Validate()
   @ApiResponse({ type: CVO_unit })
@@ -51,7 +52,7 @@ export class UnitController implements BaseController {
     return result;
   }
 
-  @Post('/:id')
+  @Post('/:id', { routerName: `修改${namePrefix}` })
   @ApiTags('修改数据')
   @Validate()
   @ApiResponse({ type: UVAO_unit })
@@ -62,7 +63,7 @@ export class UnitController implements BaseController {
     return result;
   }
 
-  @Del('/:id')
+  @Del('/:id', { routerName: `删除${namePrefix}` })
   @ApiTags('删除数据')
   @Validate()
   async delete(@Param('id') id: number) {

+ 2 - 1
src/entity/platform/achievement.entity.ts

@@ -1,5 +1,6 @@
 import { Column, Entity } from 'typeorm';
 import { BaseModel } from '../../frame/BaseModel';
+import * as dayjs from 'dayjs';
 @Entity('achievement')
 export class Achievement extends BaseModel {
   @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
@@ -20,7 +21,7 @@ export class Achievement extends BaseModel {
   technology: string;
   @Column({ type: 'jsonb', nullable: true, comment: '成果地区' })
   area: Array<any>;
-  @Column({ type: 'timestamp without time zone', comment: '发布时间' })
+  @Column({ type: 'timestamp without time zone', comment: '发布时间', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
   time: Date;
   @Column({ type: 'character varying', nullable: true, comment: '参考价格' })
   money: string;

+ 2 - 2
src/entity/platform/chat.entity.ts

@@ -1,6 +1,6 @@
 import { Entity, Column } from 'typeorm';
 import { BaseModel } from '../../frame/BaseModel';
-
+import * as dayjs from 'dayjs';
 @Entity('chat')
 export class Chat extends BaseModel {
   @Column({ type: 'integer', comment: '发送者id' })
@@ -11,7 +11,7 @@ export class Chat extends BaseModel {
   type: string;
   @Column({ type: 'text', comment: '内容' })
   content: string;
-  @Column({ type: 'timestamp without time zone', comment: '发送时间' })
+  @Column({ type: 'timestamp without time zone', comment: '发送时间', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
   send_time: Date;
   @Column({ type: 'character varying', comment: '是否已读', default: '0' })
   is_read: string;

+ 2 - 2
src/entity/platform/collection.entity.ts

@@ -1,6 +1,6 @@
 import { Column, Entity } from 'typeorm';
 import { BaseModel } from '../../frame/BaseModel';
-
+import * as dayjs from 'dayjs';
 @Entity('collection')
 export class Collection extends BaseModel {
   @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
@@ -9,6 +9,6 @@ export class Collection extends BaseModel {
   source: number;
   @Column({ type: 'character varying', nullable: true, comment: '类型' })
   type: string;
-  @Column({ type: 'timestamp without time zone', nullable: true, comment: '收藏时间' })
+  @Column({ type: 'timestamp without time zone', nullable: true, comment: '收藏时间', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
   time: Date;
 }

+ 2 - 2
src/entity/platform/news.entity.ts

@@ -1,6 +1,6 @@
 import { Entity, Column } from 'typeorm';
 import { BaseModel } from '../../frame/BaseModel';
-
+import * as dayjs from 'dayjs';
 @Entity('news')
 export class News extends BaseModel {
   @Column({ type: 'character varying', nullable: true, comment: '标题' })
@@ -9,7 +9,7 @@ export class News extends BaseModel {
   logo: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '发布人' })
   person: string;
-  @Column({ type: 'timestamp without time zone', nullable: true, comment: '发布时间' })
+  @Column({ type: 'timestamp without time zone', nullable: true, comment: '发布时间', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
   time: Date;
   @Column({ type: 'character varying', nullable: true, comment: '内容' })
   content: string;

+ 1 - 1
src/entity/platform/tags.entity.ts

@@ -11,7 +11,7 @@ export class Tags extends BaseModel {
   href: string;
   @Column({ type: 'character varying', nullable: true, comment: '英文标题' })
   English: string;
-  @Column({ type: 'jsonb', nullable: true, comment: '子菜单' })
+  @Column({ type: 'jsonb', nullable: true, comment: '子目录' })
   children: Array<any>;
   @Column({ type: 'character varying', nullable: true, comment: '排序' })
   sort: number;

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

@@ -15,6 +15,6 @@ export class Dept extends BaseModel {
   is_super: string;
   @Column({ type: 'integer', nullable: true, comment: '排序' })
   order_num: number;
-  @Column({ type: 'character varying', comment: '是否为默认菜单 默认:0,非默认:1; 默认不能删除', default: '1' })
+  @Column({ type: 'character varying', comment: '是否为默认目录 默认:0,非默认:1; 默认不能删除', default: '1' })
   is_default: string;
 }

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

@@ -8,13 +8,13 @@ import { BaseModel } from '../../frame/BaseModel';
 // }
 @Entity('menus')
 export class Menus extends BaseModel {
-  @Column({ type: 'character varying', comment: '菜单名称' })
+  @Column({ type: 'character varying', comment: '目录名称' })
   name: string;
   @Column({ type: 'character varying', comment: '路由名称 英文' })
   route_name: string;
   @Column({ type: 'character varying', comment: '国际化编码' })
   i18n_code: string;
-  @Column({ type: 'integer', nullable: true, comment: '父级菜单' })
+  @Column({ type: 'integer', nullable: true, comment: '父级目录' })
   parent_id: number;
   @Column({ type: 'integer', nullable: true, comment: '显示顺序' })
   order_num: number;
@@ -22,13 +22,13 @@ export class Menus extends BaseModel {
   path: string;
   @Column({ type: 'character varying', nullable: true, comment: '组件地址' })
   component: string;
-  @Column({ type: 'character varying', comment: '菜单类型 0:目录;1:菜单;2:子页面' })
+  @Column({ type: 'character varying', comment: '目录类型 0:目录;1:目录;2:子页面' })
   type: string;
   @Column({ type: 'character varying', nullable: true, comment: '图标' })
   icon: string;
   @Column({ type: 'jsonb', nullable: true, comment: '功能列表 不在功能列表中的功能不能使用' })
   config: Array<any>;
-  @Column({ type: 'character varying', comment: '是否为默认菜单 默认:0,非默认:1; 默认不能删除', default: '1' })
+  @Column({ type: 'character varying', comment: '是否为默认目录 默认:0,非默认:1; 默认不能删除', default: '1' })
   is_default: string;
   @Column({ type: 'text', nullable: true, comment: '备注' })
   remark: string;

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

@@ -7,7 +7,7 @@ export class Role extends BaseModel {
   name: string;
   @Column({ type: 'character varying', comment: '角色编码' })
   code: string;
-  @Column({ type: 'jsonb', default: [], comment: '菜单' })
+  @Column({ type: 'jsonb', default: [], comment: '目录' })
   menu: Array<string>;
   @Column({ type: 'text', nullable: true, comment: '简介' })
   brief: string;

+ 2 - 2
src/entity/users/company.entity.ts

@@ -1,6 +1,6 @@
 import { Column, Entity } from 'typeorm';
 import { BaseModel } from '../../frame/BaseModel';
-
+import * as dayjs from 'dayjs';
 @Entity('company')
 export class Company extends BaseModel {
   @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
@@ -31,7 +31,7 @@ export class Company extends BaseModel {
   @Column({ type: 'character varying', nullable: true, comment: '简介' })
   register: string;
 
-  @Column({ type: 'timestamp without time zone', nullable: true, comment: '成立日期' })
+  @Column({ type: 'timestamp without time zone', nullable: true, comment: '成立日期', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
   create_time: Date;
   @Column({ type: 'character varying', nullable: true, comment: '地址' })
   address: string;

+ 2 - 2
src/entityLogs/opera.entity.ts

@@ -1,5 +1,5 @@
 import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
-
+import * as dayjs from 'dayjs';
 @Entity('opera', { comment: '操作日志' })
 export class Opera {
   @PrimaryGeneratedColumn({ type: 'integer' })
@@ -12,7 +12,7 @@ export class Opera {
   ip: string;
   @Column({ type: 'character varying', nullable: true, comment: '设备' })
   device: string;
-  @Column({ type: 'timestamp without time zone', nullable: true, comment: '时间' })
+  @Column({ type: 'timestamp without time zone', nullable: true, comment: '时间', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
   time: Date;
   @Column({ type: 'character varying', nullable: true, comment: '操作地址' })
   referer: string;

+ 16 - 0
src/filter/defaultError.filter.ts

@@ -0,0 +1,16 @@
+import { ApplicationContext, Catch, IMidwayContainer, Inject } from '@midwayjs/core';
+import { Context } from '@midwayjs/koa';
+
+// 非自定义异常
+@Catch()
+export class DefaultErrorFilter {
+  @Inject()
+  ctx: Context;
+  @ApplicationContext()
+  applicationContext: IMidwayContainer;
+  async catch(err: Error, ctx: Context) {
+    console.error(err);
+    // 接收并处理系统定义错误
+    throw err;
+  }
+}

+ 2 - 2
src/interface/platform/tags.interface.ts

@@ -18,7 +18,7 @@ export class FVO_tags {
   'sort': number = undefined;
   @ApiProperty({ description: '英文标题' })
   'English': string = undefined;
-  @ApiProperty({ description: '子菜单' })
+  @ApiProperty({ description: '子目录' })
   'children': Array<any> = undefined;
   @ApiProperty({ description: '备注' })
   'remark': string = undefined;
@@ -58,7 +58,7 @@ export class CDTO_tags {
   @ApiProperty({ description: '排序' })
   @Rule(RuleType['number']().empty(''))
   'sort': number = undefined;
-  @ApiProperty({ description: '子菜单' })
+  @ApiProperty({ description: '子目录' })
   @Rule(RuleType['array']().empty(''))
   'children': Array<any> = undefined;
   @ApiProperty({ description: '备注' })

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

@@ -7,13 +7,13 @@ export class FVO_menus {
   }
   @ApiProperty({ description: '数据id' })
   id: number = undefined;
-  @ApiProperty({ description: '菜单名称' })
+  @ApiProperty({ description: '目录名称' })
   'name': string = undefined;
   @ApiProperty({ description: '路由名称' })
   'route_name': string = undefined;
   @ApiProperty({ description: '国际化编码' })
   'i18n_code': string = undefined;
-  @ApiProperty({ description: '父级菜单' })
+  @ApiProperty({ description: '父级目录' })
   'parent_id': number = undefined;
   @ApiProperty({ description: '显示顺序' })
   'order_num': number = undefined;
@@ -21,13 +21,13 @@ export class FVO_menus {
   'path': string = undefined;
   @ApiProperty({ description: '组件地址' })
   'component': string = undefined;
-  @ApiProperty({ description: '菜单类型' })
+  @ApiProperty({ description: '目录类型' })
   'type': string = undefined;
   @ApiProperty({ description: '图标' })
   'icon': string = undefined;
   @ApiProperty({ description: '功能列表' })
   'config': Array<any> = undefined;
-  @ApiProperty({ description: '是否为默认菜单' })
+  @ApiProperty({ description: '是否为默认目录' })
   'is_default': string = undefined;
   @ApiProperty({ description: '备注' })
   'remark': string = undefined;
@@ -36,9 +36,9 @@ export class FVO_menus {
 }
 
 export class QDTO_menus {
-  @ApiProperty({ description: '父级菜单' })
+  @ApiProperty({ description: '父级目录' })
   'parent_id': number = undefined;
-  @ApiProperty({ description: '菜单类型' })
+  @ApiProperty({ description: '目录类型' })
   'type': string = undefined;
   @ApiProperty({ description: '是否启用' })
   'is_use': string = undefined;
@@ -52,7 +52,7 @@ export class QVO_menus extends FVO_menus {
 }
 
 export class CDTO_menus {
-  @ApiProperty({ description: '菜单名称' })
+  @ApiProperty({ description: '目录名称' })
   @Rule(RuleType['string']().empty(''))
   'name': string = undefined;
   @ApiProperty({ description: '路由名称' })
@@ -61,7 +61,7 @@ export class CDTO_menus {
   @ApiProperty({ description: '国际化编码' })
   @Rule(RuleType['string']().empty(''))
   'i18n_code': string = undefined;
-  @ApiProperty({ description: '父级菜单' })
+  @ApiProperty({ description: '父级目录' })
   @Rule(RuleType['number']().empty(''))
   'parent_id': number = undefined;
   @ApiProperty({ description: '显示顺序' })
@@ -73,7 +73,7 @@ export class CDTO_menus {
   @ApiProperty({ description: '组件地址' })
   @Rule(RuleType['string']().empty(''))
   'component': string = undefined;
-  @ApiProperty({ description: '菜单类型' })
+  @ApiProperty({ description: '目录类型' })
   @Rule(RuleType['string']().empty(''))
   'type': string = undefined;
   @ApiProperty({ description: '图标' })
@@ -82,7 +82,7 @@ export class CDTO_menus {
   @ApiProperty({ description: '功能列表' })
   @Rule(RuleType['array']().empty(''))
   'config': Array<any> = undefined;
-  @ApiProperty({ description: '是否为默认菜单' })
+  @ApiProperty({ description: '是否为默认目录' })
   @Rule(RuleType['string']().empty(''))
   'is_default': string = undefined;
   @ApiProperty({ description: '备注' })

+ 2 - 2
src/interface/system/role.interface.ts

@@ -11,7 +11,7 @@ export class FVO_role {
   'name': string = undefined;
   @ApiProperty({ description: '角色编码' })
   'code': string = undefined;
-  @ApiProperty({ description: '菜单' })
+  @ApiProperty({ description: '目录' })
   'menu': Array<any> = undefined;
   @ApiProperty({ description: '简介' })
   'brief': string = undefined;
@@ -44,7 +44,7 @@ export class CDTO_role {
   @ApiProperty({ description: '角色编码' })
   @Rule(RuleType['string']().empty(''))
   'code': string = undefined;
-  @ApiProperty({ description: '菜单' })
+  @ApiProperty({ description: '目录' })
   @Rule(RuleType['array']().empty(''))
   'menu': Array<any> = undefined;
   @ApiProperty({ description: '简介' })

+ 1 - 1
src/service/login.service.ts

@@ -91,7 +91,7 @@ export class LoginService {
   async updatePwd(data: UPwdDTO, type: LoginType) {
     let model;
     if (type === LoginType.Admin) model = this.adminModel;
-    // TODO: 缺少user登录映射到model变量上
+    else model = this.userModel;
     const user = await model.findOne({ where: { id: Equal(data.id) } });
     if (!user) new ServiceError(ErrorCode.USER_NOT_FOUND);
     user.password = data.password;

+ 8 - 6
src/service/system/role.service.ts

@@ -5,7 +5,7 @@ import { BaseService, QueryOpera } from '../../frame/BaseService';
 import { Role } from '../../entity/system/role.entity';
 import { Context } from '@midwayjs/koa';
 import { AdminService } from './admin.service';
-import { compact, flattenDeep, get, last, lowerFirst, uniq, upperFirst } from 'lodash';
+import { compact, flattenDeep, get, isArray, last, lowerFirst, uniq, upperFirst } from 'lodash';
 import { DeptService } from './dept.service';
 import { Opera } from '../../frame/dbOpera';
 import { MenusService } from './menus.service';
@@ -27,6 +27,7 @@ export class RoleService extends BaseService<Role> {
   //是否是超级管理员
   async isSuperAdmin() {
     const user = this.ctx.user;
+    // if (isArray(user.role) && user.role.includes('Admin')) {
     if (user.is_super) {
       const qb: QueryOpera[] = [{ column: 'id', value: user.id, opera: [Opera.Equal] }];
       const admin = await this.adminService.fetch(qb);
@@ -91,7 +92,7 @@ export class RoleService extends BaseService<Role> {
     allCodes = uniq(allCodes);
     // 只获取编码,直接返回
     if (needCode) return allCodes;
-    // 根据编码获取菜单数据
+    // 根据编码获取目录数据
     const menuCodes = this.setMenuCodes(allCodes);
     const qb = [{ column: 'route_name', opera: [Opera.In], value: menuCodes }];
     const { data: menuList } = await this.menusService.query(qb);
@@ -100,9 +101,9 @@ export class RoleService extends BaseService<Role> {
     return { menus: treeMenu, role_code: allCodes };
   }
   /**
-   * 整理出角色菜单的编码,主要是与route_name编码对应
+   * 整理出角色目录的编码,主要是与route_name编码对应
    * @param allCodes 本用户的角色+部门的完整权限编码
-   * @returns 菜单需要的编码
+   * @returns 目录需要的编码
    */
   setMenuCodes(allCodes: Array<string>) {
     const result = [];
@@ -139,6 +140,7 @@ export class RoleService extends BaseService<Role> {
    * @returns 权限列表
    */
   async getRoleCodes(roleCode: Array<string>) {
+    if (!roleCode) return [];
     const roleCodes = [];
     for (const rc of roleCode) {
       roleCodes.push(lowerFirst(rc));
@@ -151,12 +153,12 @@ export class RoleService extends BaseService<Role> {
   }
 
   /**
-   * 根据角色id数组,整理菜单
+   * 根据角色id数组,整理目录
    * @param roleIdList 角色id数组
    */
   async getMenuByRoles(roleIdList) {
     let menus = [];
-    // 第一步,整理所有菜单至一维数组
+    // 第一步,整理所有目录至一维数组
     for (const r of roleIdList) {
       menus.push(...flattenDeep(r));
     }