import request from '@/utils/require'
import requestFile from '@/utils/requireFile'
import { root, FileApi } from '@/api/index'
//获取左侧导航
export function getLeftNav(id, queryPage, querySize) {
	return request({
		url: `${root}/module/getDetail/${queryPage}/${querySize}?id=${id}`,
		method: 'get',
	});
}
//获取邮件列表
export function getAllMail(activeId, activeType, queryPage, querySize) {
	return request({
		url: `${root}/mail/findByMid/${queryPage}/${querySize}?moduleId=${activeId}&type=${activeType}`,
		method: 'get'
	});
}
//获取详情
export function getMailInfo(infoId) {
	return request({
		url: `${root}/mail/findById?id=${infoId}`,
		method: 'get',
	});
}
//提交新邮件
export function submitForm(formObj) {
	return request({
		url: `${root}/mail/save`,
		method: 'post',
		data: JSON.stringify(formObj)
	})
}
//提交文件上传
export function uploadFn(param) {
	return requestFile({
		url: `${FileApi}/file/upload`,
		method: 'post',
		data: param
	})
}
//获取验证码
export function getCode() {
	return request({
		url: `${root}/mail/securityCode`,
		method: 'get',
	});
}
//省级联动
export function provincial(id) {
	return request({
		url: `${root}/city/findByPid?id=${id}`,
		method: 'get'
	});
}