import request from '@/utils/request'
import {
  UPMS_SREVICE,
  AUTH_SREVICE,
  SJZD_SREVICE
} from '@/api/module/urls'

const client_id = 'web'
const client_secret = '123456'
const scope = 'server'

// 登录方法
export function login(username, password, clienttype) {
  return request({
    url: '/login',
    method: 'post',
    params: {
      username,
      password,
      clienttype
    }
  })
}

// 刷新方法
export function refreshToken() {
  return request({
    url: AUTH_SREVICE + '/auth/refresh',
    method: 'post'
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: UPMS_SREVICE + '/system/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'delete'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/code',
    method: 'get'
  })
}