import $http from '@/common/request.js'
import config from '@/config'
import store from '@/store/index.js'
function getProjectId() {
  const userInfo = store.state.user.userInfo
  return userInfo
}
//  客服
function customerservice() {
  let params = {
    'criteria': {
      'projectId': getProjectId().projectId,
      'state': 1
    }
  }
  return $http({
    serverSp: config.brsgServer.duoduoUrl,
    url: `/server/duoduoenv/customerservice/query`,
    method: 'POST',
    isNotShowErrorToast: true,
    errorSave: true,
    data: JSON.stringify(params)
  })
}
//  个人信心
function queryUserById() {
  return $http({
    serverSp: config.brsgServer.duoduoUrl,
    url: `/duoduo-service/setup-service/user/queryUserById?userId=${getProjectId().userId}`,
    method: 'GET',
    isNotShowErrorToast: true,
    errorSave: true
  })
}

export {
    customerservice,
    queryUserById
}
