Skip to content

Commit 0ecfd48

Browse files
committed
added enviornment variables
1 parent 72ab1d0 commit 0ecfd48

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VUE_APP_ROOT_API=http://localhost:8000
2+
VUE_APP_ROOT_MEDIA=http://localhost:8000

.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VUE_APP_ROOT_API=http://localhost:8000
2+
VUE_APP_ROOT_MEDIA=http://localhost:8000

src/apps/auth/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import axios from 'axios'
77
import '@/index.css'
88

99

10-
axios.defaults.baseURL = 'http://localhost:8000'
10+
axios.defaults.baseURL = process.env.VUE_APP_ROOT_API
1111

1212

1313
createApp(App)

src/apps/student/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import axios from 'axios'
77
import '@/index.css'
88

99

10-
axios.defaults.baseURL = 'http://localhost:8000'
10+
axios.defaults.baseURL = process.env.VUE_APP_ROOT_API
1111

1212

1313
createApp(App)

src/apps/student/views/resources/ResourceDetail.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default({
5555
document.title = 'Resource: ' + this.resource.res_name
5656
5757
this.resource.res_files.forEach(file => {
58-
file.url = axios.defaults.baseURL + file.file
58+
file.url = process.env.VUE_APP_ROOT_MEDIA + file.file
5959
});
6060
},
6161
},

src/apps/teacher/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import axios from 'axios'
77
import '@/index.css'
88

99

10-
axios.defaults.baseURL = 'http://localhost:8000'
10+
axios.defaults.baseURL = process.env.VUE_APP_ROOT_API
1111

1212

1313
createApp(App)

0 commit comments

Comments
 (0)