import request from "@/utils/request";
let { api } = process.env.CONFIG;

/**获取用户信息 */
export async function loginUserInfo() {
  return request({ url: api + "/erp/user/loginUserInfo" })
}

/**获取菜单路由*/
export async function getMenu(): Promise<any> {
  return request({
    url: api + "/erp/menu/getRouters",
    method: "PUT",
    data: ["corp_operations"]
  })
}

/**退出登录*/
export async function outLogin() {
  return request({
    url: api + '/erp/user/logout',
    method: 'DELETE'
  })
}
// 选择公司
export async function selectCompanyApi(companyId: number) {
  return request({
    url: api + `/erp/user/chooseCompany/${companyId}`,
    method: 'PUT'
  })
}