perf: 邮箱设置改为系统设置,普通用户无需配置发件邮箱

This commit is contained in:
xiaojunnuo
2024-10-11 02:54:42 +08:00
parent f23c4af2ad
commit 4244569211
16 changed files with 130 additions and 86 deletions
@@ -83,6 +83,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
let newSetting: T = new type();
const savedSettings = await this.getSettingByKey(key);
newSetting = _.merge(newSetting, savedSettings);
await this.saveSetting(newSetting);
await this.cache.set(cacheKey, newSetting);
return newSetting;
}
@@ -95,6 +96,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
const entity = await this.getByKey(key);
if (entity) {
entity.setting = JSON.stringify(bean);
entity.access = type.__access__;
await this.repository.save(entity);
} else {
const newEntity = new SysSettingsEntity();