import { axios } from "./http"; // 获取列表 export function getList(type,data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `api/web/${type}/list`, }).then((res) => { cb(res); }); } // 获取详情 export function getDetail(type,data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `api/web/${type}/list`, }).then((res) => { cb(res); }); } // 访问量 export function getVisit(cb) { axios({ method: "get", url: `api/web/webVisit`, }).then((res) => { cb(res); }); } // 登录 export function login(data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `admin/login`, }).then((res) => { cb(res); }); } // 登出 export function logout(cb) { axios({ method: "get", url: `admin/logout`, }).then((res) => { cb(res); }); } // 用户详情 export function getUserInfo(data,cb) { axios({ method: "get", url: `cms/web/manage/user/detail/${data.id}`, }).then((res) => { cb(res); }); } //获取留言树 export function getMsg(data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `api/web/comment/listTree`, }).then((res) => { cb(res); }); } //提交留言接口 export function saveMsg(type,data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `cms/web/manage/${type}/save`, }).then((res) => { cb(res); }); } //提交弹幕接口 export function saveBarrage(data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `cms/web/manage/barrageSave`, }).then((res) => { cb(res); }); } //获取详情 export function getDetailById(type,data, cb) { axios({ method: "get", url: `api/web/${type}/detail/${data.id}`, }).then((res) => { cb(res); }); } //拜祭 export function mournVisit(data, cb=()=>{}) { axios({ method: "get", url: `api/web/martyr/visit/${data.id}`, }).then((res) => { cb(res); }); } //获取悼念列表 export function getMournList(data, cb) { axios({ method: "get", url: `api/web/mourn/comment/${data.id}`, }).then((res) => { cb(res); }); } //获取题组列表 export function getQuestionGroupList(data, cb) { let params = { ...data }; axios({ method: "post", data:params, url: `cms/web/manage/questionGroup/list`, }).then((res) => { cb(res); }); } //获取题目详情 export function getQuestionGroupDetail(data, cb) { axios({ method: "get", url: `cms/web/manage/questionGroup/detail/${data.id}`, }).then((res) => { cb(res); }); } //提交留言接口 export function submitAnswers(data, cb) { let params = { ...data }; axios({ method: "post", data: params, url: `cms/web/manage/questionUser/submit`, }).then((res) => { cb(res); }); } //获取排名列表 export function getRanking(data, cb) { axios({ method: "get", url: `cms/web/manage/questionUser/ranking/${data.id}`, }).then((res) => { cb(res); }); } //检测是否登录 export function checkLogin(cb) { axios({ method: "get", url: `admin/checkLogin`, }).then((res) => { cb(res); }); } //检测是否可修改密码 export function checkCanEditPsd(data,cb) { axios({ method: "post", data, url: `api/web/retrieve/password`, }).then((res) => { cb(res); }); } //找回密码 export function updatePwd(data,cb) { axios({ method: "post", data, url: `api/web/updatePwd`, }).then((res) => { cb(res); }); } //修改密码 export function updateSysPwd(data,cb) { axios({ method: "post", data, url: `sys/user/updatePwd`, }).then((res) => { cb(res); }); } //获取点赞 export function getStar(cb) { axios({ method: "get", url: `api/web/scene/getStar`, }).then((res) => { cb(res); }); } //点赞 export function dianzan(cb) { axios({ method: "get", url: `api/web/scene/star`, }).then((res) => { cb(res); }); } //获取知识详情 export function getNewsDetail(data, cb=()=>{}) { axios({ method: "get", url: `api/web/news/detail/${data.id}`, }).then((res) => { cb(res); }); } // 获取精品典藏tab列表和学习园地 export const getTabList = (type) => { return axios({ method: 'post', url: `api/web/goods/module/list/${type}`, }) } // 保存网站访问量 数字史馆 精品典藏 …… export const setVisit = (type) => { return axios({ method: 'get', url: `api/web/visit/${type}`, }) } // 精品典藏的 // 点赞 export const goodsLikeApi = (data) => { return axios({ method: 'post', url: 'cms/web/manage/goods/like', data }) } // 取消点赞 export const goodsLikeDelApi = (goodsId) => { return axios({ method: 'get', url: `cms/web/manage/goods/like/del/${goodsId}`, }) } // 投票 export const goodsVoteApi = (data) => { return axios({ method: 'post', url: 'cms/web/manage/goods/vote', data }) } // 取消投票 export const goodsVoteDelApi = (goodsId) => { return axios({ method: 'get', url: `cms/web/manage/goods/vote/del/${goodsId}`, }) } // 检查留言--------- export const webMesCheck = () => { return axios({ method: 'get', url: '/cms/web/manage/check/message', }) }