import request from '@/utils/request'

class Authorize {
  loadByName(authorizeName, page) {
    let url = '/setCenter/UnionSet/unionList?type=' + authorizeName
    if (page !== undefined) {
      url += `&p=${page}`
    }
    return request({
      url: url,
      method: 'get'
      // params: { webId }
    })
  }

  updataByName(name, data) {
    return request({
      url: '/setCenter/ThirdParty/' + name,
      method: 'post',
      headers: { 'Content-Type': 'text/plain' },
      data
      // params: { webId }
    })
  }

  unionUse(data) {
    return request({
      url: '/setCenter/UnionSet/unionUse',
      method: 'post',
      headers: { 'Content-Type': 'text/plain' },
      data
    })
  }

  unionDelete(data) {
    return request({
      url: '/setCenter/UnionSet/unionDel',
      method: 'post',
      headers: { 'Content-Type': 'text/plain' },
      data
    })
  }
}

export default Authorize
