feat: update
This commit is contained in:
27
frontend/wechat/src/api/postApi.js
Normal file
27
frontend/wechat/src/api/postApi.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import client from './client';
|
||||
|
||||
export const postApi = {
|
||||
list({ page = 1, limit = 10, keyword = '' } = {}) {
|
||||
return client.get('/api/posts', {
|
||||
params: {
|
||||
page,
|
||||
limit,
|
||||
keyword: keyword.trim()
|
||||
}
|
||||
});
|
||||
},
|
||||
show(id) {
|
||||
return client.get(`/api/posts/${id}`);
|
||||
},
|
||||
mine({ page = 1, limit = 10 } = {}) {
|
||||
return client.get('/api/posts/mine', {
|
||||
params: {
|
||||
page,
|
||||
limit
|
||||
}
|
||||
});
|
||||
},
|
||||
buy(id) {
|
||||
return client.post(`/api/posts/buy/${id}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user