perf: 调整静态资源到static目录

This commit is contained in:
xiaojunnuo
2024-10-04 00:52:19 +08:00
parent a21889080d
commit 0584b3672b
59 changed files with 131 additions and 136 deletions
@@ -1,6 +1,5 @@
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
import { BaseController } from '@certd/lib-server';
import { PlusService } from '../basic/service/plus-service.js';
import { BaseController, PlusService } from '@certd/lib-server';
import { AppKey } from '@certd/pipeline';
import { SysSettingsService } from '@certd/lib-server';
import { SysInstallInfo } from '@certd/lib-server';
@@ -1,11 +1,10 @@
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
import { logger } from '@certd/pipeline';
import { UserService } from '../authority/service/user-service.js';
import { SysSettingsService } from '@certd/lib-server';
import { PlusService, SysSettingsService } from '@certd/lib-server';
import { nanoid } from 'nanoid';
import { SysInstallInfo, SysPrivateSettings } from '@certd/lib-server';
import crypto from 'crypto';
import { PlusService } from '../basic/service/plus-service.js';
export type InstallInfo = {
installTime: number;
@@ -23,7 +23,6 @@ export class AutoRegisterCron {
@Init()
async init() {
logger.info('加载定时trigger开始');
await this.pipelineService.onStartup(this.immediateTriggerOnce, this.onlyAdminUser);
logger.info('加载定时trigger完成');
//
@@ -10,6 +10,7 @@ import * as fs from 'fs';
import { logger } from '@certd/pipeline';
import { AuthService } from '../../authority/service/auth-service.js';
import { SysSettingsService } from '@certd/lib-server';
import { In } from 'typeorm';
/**
* 证书
@@ -35,16 +36,34 @@ export class HistoryController extends CrudController<HistoryService> {
}
@Post('/page', { summary: Constants.per.authOnly })
async page(@Body(ALL) body) {
async page(@Body(ALL) body: any) {
const isAdmin = await this.authService.isAdmin(this.ctx);
const publicSettings = await this.sysSettingsService.getPublicSettings();
const pipelineQuery: any = {};
if (!(publicSettings.managerOtherUserPipeline && isAdmin)) {
body.query.userId = this.ctx.user.id;
pipelineQuery.userId = this.ctx.user.id;
}
const res = await super.page(body);
let pipelineIds: any = null;
const pipelineTitle = body.query?.pipelineTitle;
if (pipelineTitle) {
const pipelines = await this.pipelineService.list(pipelineQuery, null, qb => {
qb.where('title like :title', { title: `%${pipelineTitle}%` });
});
pipelineIds = pipelines.map(p => p.id);
}
return res;
const buildQuery = qb => {
if (pipelineIds) {
qb.where({
pipelineId: In(pipelineIds),
});
}
};
const res = await this.service.page(body?.query, body?.page, body?.sort, buildQuery);
return this.ok(res);
}
@Post('/list', { summary: Constants.per.authOnly })
@@ -18,6 +18,9 @@ import { logger } from '@certd/pipeline';
export class HistoryService extends BaseService<HistoryEntity> {
@InjectEntityModel(HistoryEntity)
repository: Repository<HistoryEntity>;
@InjectEntityModel(PipelineEntity)
pipelineRepository: Repository<PipelineEntity>;
@Inject()
logService: HistoryLogService;