21 lines
591 B
JavaScript
21 lines
591 B
JavaScript
const DEFAULT_CONFIG = {
|
||
//接口地址
|
||
API_URL: get_api_url(),
|
||
//name
|
||
APP_TUTLE:'气味分析',
|
||
//请求超时
|
||
TIMEOUT: 30000,
|
||
}
|
||
function get_api_url(){
|
||
if(process.env.ENV === 'development' || (process.env.ENV === 'production' && window.location.host.indexOf('localhost') > -1)){
|
||
return process.env.VUE_APP_BASE_API
|
||
}
|
||
return 'http://' + window.location.host + '/api'
|
||
}
|
||
// // 如果生产模式,就合并动态的APP_CONFIG
|
||
// // public/config.js
|
||
// if (process.env.NODE_ENV === 'production') {
|
||
// Object.assign(DEFAULT_CONFIG, APP_CONFIG)
|
||
// }
|
||
|
||
module.exports = DEFAULT_CONFIG |