From 3f7ffa79f51b35562d6d0c99fb230b73d6e45d54 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 30 Nov 2021 10:57:26 +0800 Subject: [PATCH] feat: support get api url from localstorage (#388) --- src/utils/api-client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/api-client.js b/src/utils/api-client.js index 79097cff..8cfd2ffd 100644 --- a/src/utils/api-client.js +++ b/src/utils/api-client.js @@ -3,7 +3,9 @@ import store from '@/store' import { message, notification } from 'ant-design-vue' import { isObject } from './util' -const apiUrl = process.env.VUE_APP_API_URL ? process.env.VUE_APP_API_URL : 'http://localhost:8080' +const storedApiUrl = localStorage.getItem('apiUrl') + +const apiUrl = storedApiUrl ? storedApiUrl : process.env.VUE_APP_API_URL const haloRestApiClient = new HaloRestAPIClient({ baseUrl: apiUrl