123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- 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',
- })
- }
|