This commit is contained in:
xiaojunnuo
2024-09-24 02:42:08 +08:00
parent 154f627f2a
commit 92aa4a6d63
12 changed files with 169 additions and 11 deletions

View File

@@ -1,8 +1,9 @@
import { Controller, Get, Inject, Provide } from '@midwayjs/core';
import { Config, Controller, Get, Inject, Provide } from '@midwayjs/core';
import { BaseController } from '../../../basic/base-controller.js';
import { Constants } from '../../../basic/constants.js';
import { SysSettingsService } from '../../system/service/sys-settings-service.js';
import { SysInstallInfo, SysPublicSettings, SysSiteInfo } from '../../system/service/models.js';
import { AppKey } from '@certd/pipeline';
/**
*/
@@ -11,6 +12,8 @@ import { SysInstallInfo, SysPublicSettings, SysSiteInfo } from '../../system/ser
export class BasicSettingsController extends BaseController {
@Inject()
sysSettingsService: SysSettingsService;
@Config('account.server.baseUrl')
accountServerBaseUrl: any;
@Get('/public', { summary: Constants.per.guest })
public async getSysPublic() {
@@ -20,13 +23,15 @@ export class BasicSettingsController extends BaseController {
@Get('/install', { summary: Constants.per.guest })
public async getInstallInfo() {
const settings = await this.sysSettingsService.getSetting(SysInstallInfo);
const settings: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
settings.accountServerBaseUrl = this.accountServerBaseUrl;
settings.appKey = AppKey;
return this.ok(settings);
}
@Get('/siteInfo', { summary: Constants.per.guest })
public async getSiteInfo() {
const settings = await this.sysSettingsService.getSetting(SysSiteInfo);
const settings: SysSiteInfo = await this.sysSettingsService.getSetting(SysSiteInfo);
return this.ok(settings);
}
}