mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: agent
This commit is contained in:
@@ -115,6 +115,11 @@ const development = {
|
||||
// 仅在匹配路径到 /api/upload 的时候去解析 body 中的文件信息
|
||||
match: /\/api\/basic\/file\/upload/,
|
||||
},
|
||||
agent: {
|
||||
enabled: false,
|
||||
contactText: '',
|
||||
contactLink: '',
|
||||
},
|
||||
} as MidwayConfig;
|
||||
mergeConfig(development, 'development');
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ALL, Body, Config, Controller, Get, Inject, Provide } from '@midwayjs/core';
|
||||
import { BaseController, Constants, SysInstallInfo, SysPublicSettings, SysSettingsService, SysSiteInfo } from '@certd/lib-server';
|
||||
import { BaseController, Constants, SysInstallInfo, SysPublicSettings, SysSettingsService, SysSiteEnv, SysSiteInfo } from '@certd/lib-server';
|
||||
import { AppKey, getPlusInfo } from '@certd/pipeline';
|
||||
|
||||
/**
|
||||
@@ -12,6 +12,9 @@ export class BasicSettingsController extends BaseController {
|
||||
@Config('account.server.baseUrl')
|
||||
accountServerBaseUrl: any;
|
||||
|
||||
@Config('agent')
|
||||
agentConfig: SysSiteEnv['agent'];
|
||||
|
||||
@Get('/public', { summary: Constants.per.guest })
|
||||
public async getSysPublic() {
|
||||
const settings = await this.sysSettingsService.getSetting(SysPublicSettings);
|
||||
@@ -32,6 +35,14 @@ export class BasicSettingsController extends BaseController {
|
||||
return this.ok(settings);
|
||||
}
|
||||
|
||||
@Get('/siteEnv', { summary: Constants.per.guest })
|
||||
public async getSiteEnv() {
|
||||
const env: SysSiteEnv = {
|
||||
agent: this.agentConfig,
|
||||
};
|
||||
return this.ok(env);
|
||||
}
|
||||
|
||||
@Get('/plusInfo', { summary: Constants.per.guest })
|
||||
async plusInfo(@Body(ALL) body: any) {
|
||||
const info = getPlusInfo();
|
||||
|
||||
Reference in New Issue
Block a user