import request from '/@/utils/request'

// 登录
export const usersLogin = (data: any) => { return request({ url: '/users/login', method: 'post', data }) }

// 获取用户信息
export const usersUserinfo = (params?: any) => { return request({ url: '/users/userinfo', method: 'get', params }) }

// 获取枚举类型
export const getEnums = (params?: any) => { return request({ url: '/enums', method: 'get', params }) }
// 图片上传
export const busUpload = `${import.meta.env.VITE_APP_BASE_URL}/file/bus/upload`

// code登录
export const usersBindLogin = (data: any) => { return request({ url: '/users/bind/login', method: 'post', data }) }

// 获取菜单列表
export function menusList(data: any) { return request({ url: '/menus/list', method: 'get', params: data }) }
// 保存菜单
export function menusSave(data: any) { return request({ url: '/menus',  method: 'post', data }) }
// 分配权限
export function menusAssign(data: any) { return request({ url: '/menus/assign',  method: 'post', data }) }
// 获取当前类型权限分配
export function assignments(data: any) { return request({ url: '/menus/assignments', method: 'get', params: data }) }
// 获取我的所有权限
export function assignmentsAll(data: any) { return request({ url: '/menus/assignments/all', method: 'get', params: data }) }
// 获取我的菜单
export function myMenu(data: any) { return request({ url: '/menus/my', method: 'get', params: data }) }
// 重置所有路由
export function menusReSet(data: any) { return request({ url: '/menus/reset',  method: 'post', data }) }

// 刷新token
export function refreshToken(data: any) { return request({ url: '/refreshToken',  method: 'post', data }) }

// stationpassenger
export function stationpassengerList(data: any) { return request({ url: '/stationpassenger/list', method: 'get', params: data }) }

export const stationpassenger = { list: stationpassengerList }

// assessment
export function assessmentPagination(data: any) { return request({ url: '/assessment/pagination', method: 'get', params: data }) }
export function assessmentDelete(data: any) { return request({ url: '/assessment', method: 'delete', data }) }
export function assessmentUpdate(data: any) { return request({ url: '/assessment', method: 'put', data }) }
export function assessmentAdd(data: any) { return request({ url: '/assessment', method: 'post', data }) }
