From 6a90f156d0c51f26fb489402725ae40d4b275aaa Mon Sep 17 00:00:00 2001 From: rustdreamer Date: Mon, 28 Aug 2023 13:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.controller.ts | 16 ++++++++++++++-- src/main.ts | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/app.controller.ts b/src/app.controller.ts index 0d52c6b..0cff5f8 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -209,8 +209,19 @@ export class AppController { @Get("/visitor") @ApiBearerAuth() async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) { - const node_visitor = await this.nodeOtherVisitorRepository.findOne({ where: { identity_card_no } }) - return node_visitor + const node_other_visitor: any = await this.nodeOtherVisitorRepository.findOne({ + where: { identity_card_no }, + order: { + created_date: "DESC" + } + }); + if (node_other_visitor) { + const node_visitor = await this.nodeVisitorRepository.findOne({ + where: { id: node_other_visitor.node_visitor_id } + }) + node_other_visitor.info = node_visitor; + } + return node_other_visitor } @Get("/visitors") @@ -380,6 +391,7 @@ export class AppController { data: result, }; } catch (e) { + console.log("e", e) return { code: -2, msg: e.message, diff --git a/src/main.ts b/src/main.ts index d658491..5f6cba5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,6 +6,7 @@ import { options } from './config/config.doc' import { SwaggerModule } from '@nestjs/swagger'; import { LoggingInterceptor } from './common/interceptor/logging.interceptor'; import * as fs from 'fs'; +import { urlencoded, json } from 'express'; /** * @@ -38,6 +39,8 @@ async function bootstrap() { }, credentials: true, }); + app.use(json({ limit: '50mb' })); + app.use(urlencoded({ extended: true, limit: '50mb' })); // app.useGlobalFilters(new HttpExceptionFilter()); app.useGlobalInterceptors(new LoggingInterceptor()); if (process.env.DOC === 'true') {