chore: env

This commit is contained in:
xiaojunnuo
2024-09-23 11:27:53 +08:00
parent e0466409d0
commit 81d6c0ebdf
6 changed files with 39 additions and 49 deletions
@@ -1,23 +1,8 @@
import { Rule, RuleType } from '@midwayjs/validate';
import { 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 } from '../../system/service/models.js';
export class SmsCodeReq {
@Rule(RuleType.number().required())
phoneCode: number;
@Rule(RuleType.string().required())
mobile: string;
@Rule(RuleType.string().required().max(10))
randomStr: string;
@Rule(RuleType.number().required().max(4))
imgCode: string;
}
import { SysInstallInfo, SysPublicSettings, SysSiteInfo } from '../../system/service/models.js';
/**
*/
@@ -38,4 +23,10 @@ export class BasicSettingsController extends BaseController {
const settings = await this.sysSettingsService.getSetting(SysInstallInfo);
return this.ok(settings);
}
@Get('/siteInfo', { summary: Constants.per.guest })
public async getSiteInfo() {
const settings = await this.sysSettingsService.getSetting(SysSiteInfo);
return this.ok(settings);
}
}
@@ -38,3 +38,13 @@ export class SysLicenseInfo extends BaseSettings {
static __access__ = 'private';
license?: string;
}
export class SysSiteInfo extends BaseSettings {
static __title__ = '站点信息';
static __key__ = 'sys.site';
static __access__ = 'public';
TITLE?: string;
SLOGAN?: string;
LOGO?: string;
ICP_NO?: string;
}