mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
code refactor
This commit is contained in:
+2
-7
@@ -1,13 +1,12 @@
|
||||
import axios from 'axios';
|
||||
|
||||
import api from "../consts/api.js";
|
||||
import userState from "./userstate.js";
|
||||
|
||||
const baseUrlPath = '/api';
|
||||
|
||||
let needBlockRequest = false;
|
||||
let blockedRequests = [];
|
||||
|
||||
axios.defaults.baseURL = baseUrlPath;
|
||||
axios.defaults.baseURL = api.baseUrlPath;
|
||||
axios.interceptors.request.use(config => {
|
||||
const token = userState.getToken();
|
||||
|
||||
@@ -113,10 +112,6 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
getDataExportUrl: () => {
|
||||
const token = userState.getToken();
|
||||
return `${baseUrlPath}/data/export.csv?token=${token}`;
|
||||
},
|
||||
getTokens: () => {
|
||||
return axios.get('v1/tokens/list.json');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user