
import fetch from '@/common/fetch.js';
import BASE_URL from './base.js';
import useNetWork from '@/common/useNetWork.js';


const GET_MESSAGE_LIST = BASE_URL + '/visitor/getMessageList';
const SOLVE_STATUS = BASE_URL + '/visitor/apply/status';
const GET_MESSAGE_INFO = BASE_URL + '/visitor/getMessageInfo';

//消息列表
export function getMessageList(param) {
	useNetWork();
  return fetch.post(GET_MESSAGE_LIST, param).then(res => res);
}

//消息详情
export function getMessageInfo(id) {
	useNetWork();
	const params = {
		messageId: id
	}
  return fetch.get(GET_MESSAGE_INFO, params).then(res => res);
}

//管理员处理申请
export function solveStatus(status, userId) {
	useNetWork();
	const params = {
		ids: userId,
		status: status
	}
  return fetch.post(SOLVE_STATUS, params).then(res => res);
}
