fix: get_api_url 优化
This commit is contained in:
parent
26cfc22854
commit
6a3be4afc2
|
@ -2,12 +2,12 @@ const DEFAULT_CONFIG = {
|
|||
//接口地址
|
||||
API_URL: get_api_url(),
|
||||
//name
|
||||
APP_TUTLE:'气味分析',
|
||||
APP_TUTLE:'',
|
||||
//请求超时
|
||||
TIMEOUT: 30000,
|
||||
}
|
||||
function get_api_url(){
|
||||
if(process.env.ENV === 'development' || (process.env.ENV === 'production' && window.location.host.indexOf('localhost') > -1)){
|
||||
if(process.env.NODE_ENV === 'development' || (process.env.NODE_ENV === 'production' && window.location.host.indexOf('localhost') > -1)){
|
||||
return process.env.VUE_APP_BASE_API
|
||||
}
|
||||
return 'https://' + window.location.host + '/api'
|
||||
|
|
Loading…
Reference in New Issue