30 lines
714 B
JavaScript
30 lines
714 B
JavaScript
const config = {
|
|
baseUrl: getBaseUrl(),
|
|
api: {
|
|
login: '/gw/open/login',
|
|
getQuestion: '/qgdzs/open/get_question',
|
|
answerQuestion: '/qgdzs/open/answer_question',
|
|
getAllCategory: '/qgdzs/open/get_all_category'
|
|
},
|
|
timeout: 30000
|
|
}
|
|
|
|
function getBaseUrl() {
|
|
var baseUrl = 'http://127.0.0.1:18503'
|
|
//#ifdef MP-WEIXIN
|
|
const accountInfo = uni.getAccountInfoSync();
|
|
if (accountInfo.miniProgram.envVersion == 'develop') {
|
|
baseUrl = 'http://127.0.0.1:18503'
|
|
}
|
|
if (accountInfo.miniProgram.envVersion == 'trial') {
|
|
baseUrl = 'https://www.hlsq.asia/api'
|
|
}
|
|
if (accountInfo.miniProgram.envVersion == 'release') {
|
|
baseUrl = 'https://www.hlsq.asia/api'
|
|
}
|
|
//#endif
|
|
return baseUrl
|
|
}
|
|
|
|
export default config
|