import ApiConstant from "~/api/ApiConstant";

// api接口请求不撤销
const cancelRequestFilter = [
  // 页面授权字段
  `${ApiConstant.PREFIX_CORE}/api/sys/field-visible/list-column-batch-by-module`,
  // 页面扩展字段
  `${ApiConstant.PREFIX_CORE}/api/sys/filed-extend-config/detail-batch`,
  `${ApiConstant.PREFIX_CORE}/api/mdm/bom/list-bom-version`,
  `${ApiConstant.PREFIX_CORE}/api/center/user-message`,
  `${ApiConstant.PREFIX_CORE}/api/sys/home`, // 收藏列表接口
  `${ApiConstant.PREFIX_CORE}/api/monitor/log/list-file`,
  `${ApiConstant.PREFIX_CORE}/api/sys/dict-data/DIC:IDE:COMPONENT_TYPE`, // 组件类型
  `${ApiConstant.PREFIX_CORE}/api/sys/dict-data/DIC:MSG:NOTICE_CATEGORY`, // 公告类别
  `${ApiConstant.PREFIX_CORE}/api/sys/dict-data/DIC:MSG:SOURCE_TYPE`, // 公告类型
  `${ApiConstant.PREFIX_CORE}/api/sys/dict-data/DIC:COMMON:WHETHER_CHAR`,
];

// https://webpack.js.org/guides/dependency-management/#requirecontext
const apiFiles = require.context("../api", true, /\.js$/);

// eslint-disable-next-line
apiFiles.keys().forEach((path) => {
  if (path !== "./index.js") {
    const value = apiFiles(path);
    (value.default || []).forEach((item) => {
      cancelRequestFilter.push(item);
    });
  }
});

export { cancelRequestFilter };

export default {};
