fixed dev/production env issue

This commit is contained in:
Marvin Zhang
2019-03-13 12:42:13 +08:00
parent 0a8471796c
commit bbd52b3e3b
5 changed files with 220 additions and 204 deletions

View File

@@ -1,7 +1,10 @@
import axios from 'axios'
const baseUrl = 'http://localhost:8000/api'
// const baseUrl = 'http://139.129.230.98:8000/api'
let baseUrl = 'http://localhost:8000'
if (process.env.NODE_ENV === 'production') {
baseUrl = 'http://139.129.230.98:8000/api'
}
// const baseUrl = process.env.API_BASE_URL || 'http://localhost:8000/api'
const request = (method, path, params, data) => {
return new Promise((resolve, reject) => {