import request from "@/utils/request.js";


export const userLogin = (username,password) => {
    return request.post("/api/v1/user/login",{username,password})
}

export const getUserInfo = () => {
    return request.get("/api/v1/users/info/info")
}

// 获取交换token（用于无感刷新）
export const getRefreshToken = (domain) => {
    return request.get("/api/v1/users/info/refresh_token", { domain })
}

// 使用交换token获取新的access token
export const refreshAccessToken = (refresh_token) => {
    return request.post("/api/v1/user/refresh_token", { refresh_token })
}