fix: issues

This commit is contained in:
yanghao05
2025-04-25 21:19:03 +08:00
parent b35abb2090
commit 5bc3ae468d
15 changed files with 129 additions and 64 deletions

View File

@@ -2,7 +2,7 @@ import axios from 'axios';
// Create axios instance with default config
const client = axios.create({
baseURL: '/',
baseURL: '/v1',
timeout: 10000,
headers: {
'Content-Type': 'application/json',

View File

@@ -2,7 +2,7 @@ import client from './client';
export const postApi = {
list({ page = 1, limit = 10, keyword = '' } = {}) {
return client.get('/api/posts', {
return client.get('/posts', {
params: {
page,
limit,
@@ -12,13 +12,13 @@ export const postApi = {
},
play(id) {
return client.get(`/api/posts/${id}/play`);
return client.get(`/posts/${id}/play`);
},
show(id) {
return client.get(`/api/posts/${id}`);
return client.get(`/posts/${id}`);
},
mine({ page = 1, limit = 10 } = {}) {
return client.get('/api/posts/mine', {
return client.get('/posts/mine', {
params: {
page,
limit
@@ -26,6 +26,6 @@ export const postApi = {
});
},
buy(id) {
return client.post(`/api/posts/buy/${id}`);
return client.post(`/posts/buy/${id}`);
}
}