fix: issues
This commit is contained in:
@@ -2,7 +2,7 @@ import axios from 'axios';
|
||||
|
||||
// Create a base axios instance
|
||||
export const apiClient = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '',
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '/v1',
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -4,6 +4,18 @@ import { resolve } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
chunkFileNames: 'static/assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'static/assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'static/assets/[ext]/[name]-[hash].[ext]',
|
||||
}
|
||||
}
|
||||
},
|
||||
base: "./",
|
||||
minify: true,
|
||||
sourceMap: true,
|
||||
plugins: [
|
||||
vue(),
|
||||
tailwindcss(),
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,18 @@ import { resolve } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
chunkFileNames: 'static/assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'static/assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'static/assets/[ext]/[name]-[hash].[ext]',
|
||||
}
|
||||
}
|
||||
},
|
||||
base: "./",
|
||||
minify: true,
|
||||
sourceMap: true,
|
||||
plugins: [
|
||||
vue(),
|
||||
tailwindcss(),
|
||||
|
||||
Reference in New Issue
Block a user