import request from '@/utils/request'

// 置顶 取消置顶
export function articletop(data) {
	return request({
		url: '/api/circle/articletop',
		method: 'post',
		data
	});
}

// 删除贴子
export function articledel(data) {
	return request({
		url: '/api/circle/articledel',
		method: 'post',
		data
	});
}

// 文章详情
export function details(data,id) {
	return request({
		url: '/api/article/details/'+id,
		method: 'get',
		data
	});
}

//处理文章详情页
export function deconstructArticle(data) {
	if (data) {
		data = data.replace(/<img/g, '<img style="width: 100% !important;height:auto"').replace(
			/<p>\S*<img/g, '<p style="line-height: 0;"><img');
	}
	return data;
}