ApiService.js 1.6 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
	},
	async allTriplet(articleIds) {
18
		return await axios.post('http://43.139.90.182:8888/csdnArticleInfo/multiTriplet', articleIds)
19 20
	},
	async onDelete(id) {
21
		return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/delete', {
22 23 24 25 26
			params: {
				id: id,
			},
		})
	},
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
	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,
		})
	},
48
}
49
export default ApiService