34 lines
942 B
JavaScript
34 lines
942 B
JavaScript
const config = {
|
|
baseUrl: getBaseUrl(),
|
|
api: {
|
|
login: '/gw/open/login',
|
|
getQuestion: '/qgdzs/open/random/question',
|
|
answerQuestion: '/qgdzs/open/random/answer',
|
|
getAllCategory: '/qgdzs/open/category/get_category',
|
|
getCategoryQuestion: '/qgdzs/open/category/question',
|
|
answerCategoryQuestion: '/qgdzs/open/category/answer',
|
|
getQuicklyQuestion: '/qgdzs/open/quickly/question',
|
|
answerQuicklyQuestion: '/qgdzs/open/quickly/answer'
|
|
},
|
|
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
|