import request from 'utils/request'

export function getLoginRandom(ngxCookie) {
  return request.get('/sms/v1/trx/randomstr', { params: { ngxCookie } })
}

export function trxLogin(params) {
  return request.post('/sms/v1/trx/login', params)
}

export function offlineToken(trxToken) {
  return request.post('/sms/v1/trx/logout', { trxToken })
}

// 理想那边给的代码调用 getAuthToken 时需要传 ip,云管目前不传
export function getIp() {
  return request({
    url: '/sso/getIp',
    headers: {
      isToken: false
    },
    method: 'get'
  })
}

export function queryAppList() {
  return request({
    url: '/queryAppList',
    method: 'get'
  })
}
