import { handle } from '../index'

const suffix = 'api-ztpt'

export const ztptGetLoginCode = (params: any) => handle({
  url: `/${suffix}/api-idaas/validata/code/${params}`,
  method: 'get',
  config: {
    responseType: 'blob'
  }
})

export const ztptLogin = (params: any) => handle({
  url: `/${suffix}/api-idaas/idaas/sso/login`,
  method: 'post',
  params
})

export const ztptGetUserInfo = () => handle({
  url: `/${suffix}/api-idaas/idaas/sso/user/info`,
  method: 'get',
})

export const ztptGetUserRoleList = () => handle({
  url: `/${suffix}/api-idaas/idaas/ps/user/roleList`,
  method: 'get',
})

export const ztptLogout = () => handle({
  url: `/${suffix}/api-idaas/mq/user/logout`,
  method: 'get',
})
