fix: get_api_url 优化

This commit is contained in:
caoqianming 2024-03-24 21:12:12 +08:00
parent 26cfc22854
commit 6a3be4afc2
1 changed files with 2 additions and 2 deletions

View File

@ -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'