import { baseUrl, component } from '@/api/scan/config'
import http from '@/api/httputils'

/**
 * 获取用户信息和token值
 */
export async function getUserInfo(param) {
    let url = `${baseUrl}${component}/user/infos`
    return await http.postJson(url, param)
}
  
/**
 * 根据登录token获取项目信息
 */
export async function getProjectsByToken(param) {
    let url = `${baseUrl}${component}/user/group/project`
    return await http.postJson(url, param)
}

/**
 * 根据登录token,用户获取菜单树
 */
 export async function getMenuByToken(param) {
    let url = `${baseUrl}${component}/user/menu/tree`
    return await http.postJson(url, param)
}

/**
 * 退出登录
 */
export async function logout(param) {
    let url = `${baseUrl}${component}/user/logout`
    return await http.postJson(url, param)
}