From 9e00e7356ff9f4fdfde727e03b0365e6881994b1 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 1 Jan 2019 23:08:13 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B9=20=D1=80?= =?UTF-8?q?=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/api/misc.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/client/api/misc.js b/client/api/misc.js index 0ef96d97..4b7905ab 100644 --- a/client/api/misc.js +++ b/client/api/misc.js @@ -1,15 +1,14 @@ import axios from 'axios'; +const api = axios.create({ + baseURL: '/api' +}); + class Misc { async loadConfig() { - const response = await axios.post('/api/config', {params: ['name', 'version']}); + const response = await api.post('/config', {params: ['name', 'version']}); return response.data; } } -let misc = null; -if (!misc) { - misc = new Misc(); -} - -export default misc; \ No newline at end of file +export default new Misc(); \ No newline at end of file