From 57007df71e1f3d5ef8d6333f002877da0ea8c3b2 Mon Sep 17 00:00:00 2001 From: Amir Date: Sat, 8 Oct 2022 21:58:15 +0800 Subject: [PATCH] add env --- .env | 1 + src/components/authentication/TheLogin.vue | 2 +- src/interceptors/axios.js | 10 +--------- 3 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..d3f895e --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VUE_APP_ROOT_URL = http://lelong-admin.test/api \ No newline at end of file diff --git a/src/components/authentication/TheLogin.vue b/src/components/authentication/TheLogin.vue index 6f75c78..56c65c1 100644 --- a/src/components/authentication/TheLogin.vue +++ b/src/components/authentication/TheLogin.vue @@ -10,7 +10,7 @@ " >
diff --git a/src/interceptors/axios.js b/src/interceptors/axios.js index 2c970db..873f024 100644 --- a/src/interceptors/axios.js +++ b/src/interceptors/axios.js @@ -3,12 +3,4 @@ import axios from "axios"; const tokenKey = "token"; axios.defaults.headers.common['X-CSRF-TOKEN'] = tokenKey; -// local api -axios.defaults.baseURL = "http://lelong-admin.test/api"; - -// local api - public -// axios.defaults.baseURL = "http://127.0.0.1:8080/api"; - -// production api -// axios.defaults.baseURL = "https://bida.arrahn.com.my/api"; - +axios.defaults.baseURL = process.env.VUE_APP_ROOT_URL; \ No newline at end of file