import { request } from '@/core/request'

interface UserInfo {
  id: number
  username: string
  avatar: string
}

export function getUserInfo(id: number) {
  return request<UserInfo>({ url: `/user/${id}` })
}

export function login(data: { username: string; password: string }) {
  return request({
    url: '/uaa/oauth/token',
    method: 'POST',
    data,
    auth:{
      username: 'client',
      password: 'secret'
    }
  })
}
