From 497796f33792175ff22e3fd0c5def1e58513dbc3 Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 28 Dec 2021 13:23:01 +0800 Subject: [PATCH] feat(aggregate): add `url` --- src/modules/aggregate/aggregate.controller.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/aggregate/aggregate.controller.ts b/src/modules/aggregate/aggregate.controller.ts index 4ef034cd..64b3ca15 100644 --- a/src/modules/aggregate/aggregate.controller.ts +++ b/src/modules/aggregate/aggregate.controller.ts @@ -1,10 +1,10 @@ import { CacheKey, CacheTTL, Controller, Get, Query } from '@nestjs/common' import { ApiProperty } from '@nestjs/swagger' +import { omit } from 'lodash' import { Auth } from '~/common/decorator/auth.decorator' import { ApiName } from '~/common/decorator/openapi.decorator' import { IsMaster } from '~/common/decorator/role.decorator' import { CacheKeys } from '~/constants/cache.constant' -import { addConditionToSeeHideContent } from '~/utils/query.util' import { AnalyzeService } from '../analyze/analyze.service' import { ConfigsService } from '../configs/configs.service' import { TimelineQueryDto, TopQueryDto } from './aggregate.dto' @@ -27,11 +27,10 @@ export class AggregateController { this.configsService.getMaster(), this.aggregateService.getAllCategory(), this.aggregateService.getAllPages(), - this.aggregateService - .getLatestNote(addConditionToSeeHideContent(isMaster)) - .then((r) => r.nid), + this.configsService.get('url'), + this.configsService.get('seo'), ]) - const [user, categories, pageMeta, lastestNoteNid] = tasks.map((t) => { + const [user, categories, pageMeta, url, seo] = tasks.map((t) => { if (t.status === 'fulfilled') { return t.value } else { @@ -40,10 +39,10 @@ export class AggregateController { }) return { user, - seo: this.configsService.get('seo'), + seo, + url: omit(url, ['adminUrl']), categories, pageMeta, - lastestNoteNid, } }