feat: update

This commit is contained in:
yanghao05
2025-04-17 09:36:09 +08:00
parent e03564631a
commit 0d0887b4fb
7 changed files with 234 additions and 376 deletions

View 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}`);
}
}