wangrong
2026-07-25 c2c8841967d9ab95e1bda8c65c2e37c8f0511005
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