examtest/test_client/src/config/index.js

21 lines
591 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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