import $http from '@/common/request.js';

function getUserHasFollowed() {
  return $http({
    url: `/home/indexWechatPublic`,
  });
}

export function getCompanyMapData(companyId) {
  return $http({
    url: `/config/map/${companyId}`,
    method: 'GET',
  });
}
//查询受控列表
export function queryControlSpaceCompany(params) {
  return $http({
    url: `/duoduo-service/setup-service/controlSpaceUser/getControlSpaceCompany`,
    method: 'POST',
    // serverSp: 'http://192.168.4.29:52015',
    data: JSON.stringify(params),
  });
}

//常驻空间快速调节卡片
export function querySpaceFunctionCard(params) {
  return $http({
    url: `/duoduo-service/setup-service/controlSpaceUser/queryPermanentSpaceFunctionCard?userId=${params.userId}&companyId=${params.companyId}`,
    method: 'GET',
   // serverSp: 'http://192.168.4.29:52015',
  });
}
//常驻空间参数属性
export function getSpaceProperty(params) {
  return $http({
    url: `/duoduo-service/duoduoenv-service/custom/spaceProperty?projectId=${params.projectId}&spaceId=${params.spaceId}`,
    method: 'GET',
  });
}
//切换公司
export function switchCompany(companyId) {
  return $http({
    url: `/duoduo-service/duoduoenv-service/userNew/switchCompany/${companyId}`,
    method: 'POST',
    isComParams: false,
  });
}
// 天气预报
export function getWeather(projectId) {
  return $http({
    isNotShowErrorToast: true,
    url: `/duoduo-service/object-service/weather/getCurrentWeather?projectId=${projectId}`,
    method: 'get',
  });
}
//扫码确认登录接 行政端
export function confirmLogin({ qrCodeId }) {
  // /duoduo-service/duoduoenv-service/userNew/confirmLogin
  return $http({
    url: `/duoduo-service/duoduoenv-service/userNew/confirmLogin/${qrCodeId}`,
    method: 'GET'
  });
}

export { getUserHasFollowed };
