/**
 * CMS Website Field API - 网站配置字段
 * 从 app 模块获取应用配置信息
 */
import request from '@/utils/request';

export interface Config {
  [key: string]: any;
}

/**
 * 获取站点配置字段
 */
export function configWebsiteField(tenantId?: number, code?: string) {
  return request({
    url: '/api/app/product/field/config',
    method: 'get',
    params: { tenantId, code },
  });
}

/**
 * 根据code获取应用字段
 */
export function getAppProductFieldByCode(code: string) {
  return request({
    url: '/api/app/product/field/' + code,
    method: 'get',
  });
}

// 导出所有方法
const cmsWebsiteFieldApi = {
  configWebsiteField,
  getAppProductFieldByCode,
};

export default cmsWebsiteFieldApi;
