ApiService.js 1.9 KB
Newer Older
1 2 3
import axios from 'axios'
// 创建一个名为 ApiService 的对象,包含您的异步方法
const ApiService = {
4
	async triplet(articleId) {
5
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/triplet?articleId=' + articleId)
6
	},
7 8 9 10

	async dealViewCount(id) {
		return await axios.get('http://43.139.90.182:8888/csdn/redPackage/getViewCountById?id=' + id)
	},
11
	async syncMyBlog() {
12
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/syncMyBlog')
13
	},
14
	async resetLikes() {
15
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/fixLikesStatus')
16
	},
17 18 19 20 21 22
	async getTodayRedPackageDetailInfo() {
		return await axios.get('http://43.139.90.182:8888/csdn/redPackage/detail/getTodayRedPackageDetailInfo')
	},
	async syncDetailInfo(id) {
		return await axios.get('http://43.139.90.182:8888/csdn/redPackage/detail/syncDetailInfo?id=' + id)
	},
23
	async allTriplet(articleIds) {
24
		return await axios.post('http://43.139.90.182:8888/csdnArticleInfo/multiTriplet', articleIds)
25 26
	},
	async onDelete(id) {
27
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/delete', {
28 29 30 31 32
			params: {
				id: id,
			},
		})
	},
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
	async redPackagePage(currentPage, pageSize, formInline) {
		return await axios.post('http://43.139.90.182:8888/csdn/redPackage/page', {
			page: currentPage,
			pageSize: pageSize,
			nickName: formInline.nickName,
			myAmountStart: formInline.myAmountStart,
			myAmountEnd: formInline.myAmountEnd,
			startDate: formInline.startDate,
			itemType: formInline.itemType == '全部' ? null : formInline.itemType,
			msg: formInline.msg == '全部' ? null : formInline.msg,
		})
	},
	async redPackageDetailList(currentPage, pageSize, orderNo, communityId, postId) {
		return await axios.post('http://43.139.90.182:8888/csdn/redPackage/detail/page', {
			page: currentPage,
			pageSize: pageSize,
			orderNo: orderNo,
			communityId: communityId,
			postId: postId,
		})
	},
54
}
55
export default ApiService