import { getVtxToken } from '@vtx/utils';
import http from "../_util/http";
var prefix = process.env.PREFIX || '';

// 获取收藏信息
export var fetchFavorite = function fetchFavorite(params) {
  return http.get('/cloud/management/api/v101/user/favorites/getUserFavoritesIds', {
    body: params
  });
};
// 添加收藏
export var saveFavorite = function saveFavorite(params) {
  return http.post('/cloud/management/api/v101/user/favorites/saveUserFavorites', {
    body: params
  });
};
// 取消收藏
export var cancelFavorite = function cancelFavorite(params) {
  return http.post('/cloud/management/api/v101/user/favorites/deleteUserFavorites', {
    body: params
  });
};
export var getTenantById = function getTenantById(id) {
  return http.get("".concat(prefix, "/cloud/management/rest/np/tenant/getTenantById"), {
    body: {
      parameters: JSON.stringify({
        id: id
      })
    }
  });
};
export var getUmsConfig = function getUmsConfig(componentCode) {
  return http.get("".concat(prefix, "/cloud/management/api/v101/user/config/component/page"), {
    body: {
      componentCode: componentCode,
      userId: getVtxToken('userId')
    }
  });
};