Feat: Add api functions
This commit is contained in:
parent
518b7a6bba
commit
3e2c6f7195
@ -1,6 +1,6 @@
|
||||
import { localAxios } from '@/utils/http-commons';
|
||||
|
||||
const local = localAxios();
|
||||
const local = localAxios;
|
||||
|
||||
function getArticles(success, fail) {
|
||||
//list
|
||||
|
@ -1,15 +1,12 @@
|
||||
import axios from 'axios';
|
||||
|
||||
// const { VITE_API_BASE_URL } ="http://localhost/";
|
||||
|
||||
function localAxios() {
|
||||
const instance = axios.create({
|
||||
baseURL: 'http://localhost',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
},
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
const localAxios = axios.create({
|
||||
baseURL: 'http://localhost:8000',
|
||||
headers: {
|
||||
'Content-type': 'application/json;charset=utf-8',
|
||||
'Access-Control-Allow-Origin': 'http://localhost:5173',
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export { localAxios };
|
||||
|
Loading…
Reference in New Issue
Block a user