src/modules/base/service/sys/param.ts
@@ -45,6 +45,30 @@ } /** * 根据key获得对应的参数 * @param key */ async getByKey(key) { const result = await this.baseSysParamEntity.findOneBy({ keyName: key }); if (result) { if (result.dataType == 0) { try { return JSON.parse(result.data); } catch (error) { return result.data; } } if (result.dataType == 1) { return result.data; } if (result.dataType == 2) { return result.data.split(','); } } return; } /** * 信息 * @param id * @param infoIgnoreProperty