import {getAxiosInstance} from "src/utils/axios";

export const http  = getAxiosInstance({
    timeout: 30 * 1000
})

export default http;

export interface locationRecordListDTO {
    startTime?:string,
    endTime?:string
}

export const locationRecord = {
    list: (dto:locationRecordListDTO, server: string)=>{
        return http.post(`${server}/location/record/list`, dto,{
            headers: {
                token: localStorage.getItem("token")
            }
        })
    }
}

export interface LoginDTO {
    account: string,
    password: string
}
export const auth = {
    login: (dto:LoginDTO, server: string)=>{
        return http.post(`${server}/auth/login`, dto)
    }
}
