2017-11-07 05:55:57 +00:00
|
|
|
import request from '@/utils/request'
|
2017-04-19 10:43:57 +00:00
|
|
|
|
2017-08-28 05:12:44 +00:00
|
|
|
export function fetchList(query) {
|
2017-11-07 05:55:57 +00:00
|
|
|
return request({
|
2020-01-09 09:21:36 +00:00
|
|
|
url: '/vue-element-admin/article/list',
|
2017-08-28 05:12:44 +00:00
|
|
|
method: 'get',
|
|
|
|
params: query
|
2017-08-22 07:43:34 +00:00
|
|
|
})
|
2017-04-19 10:43:57 +00:00
|
|
|
}
|
2017-04-23 11:50:32 +00:00
|
|
|
|
2018-05-30 07:25:08 +00:00
|
|
|
export function fetchArticle(id) {
|
2017-11-07 05:55:57 +00:00
|
|
|
return request({
|
2020-01-09 09:21:36 +00:00
|
|
|
url: '/vue-element-admin/article/detail',
|
2018-05-30 07:25:08 +00:00
|
|
|
method: 'get',
|
|
|
|
params: { id }
|
2017-08-22 07:43:34 +00:00
|
|
|
})
|
2017-04-23 11:50:32 +00:00
|
|
|
}
|
|
|
|
|
2017-08-28 05:12:44 +00:00
|
|
|
export function fetchPv(pv) {
|
2017-11-07 05:55:57 +00:00
|
|
|
return request({
|
2020-01-09 09:21:36 +00:00
|
|
|
url: '/vue-element-admin/article/pv',
|
2017-08-28 05:12:44 +00:00
|
|
|
method: 'get',
|
|
|
|
params: { pv }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2017-11-30 10:02:31 +00:00
|
|
|
export function createArticle(data) {
|
|
|
|
return request({
|
2020-01-09 09:21:36 +00:00
|
|
|
url: '/vue-element-admin/article/create',
|
2017-11-30 10:02:31 +00:00
|
|
|
method: 'post',
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function updateArticle(data) {
|
|
|
|
return request({
|
2020-01-09 09:21:36 +00:00
|
|
|
url: '/vue-element-admin/article/update',
|
2017-11-30 10:02:31 +00:00
|
|
|
method: 'post',
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|