存档点
This commit is contained in:
24
config.js
24
config.js
@@ -1,11 +1,29 @@
|
||||
const config = {
|
||||
baseUrl: 'http://127.0.0.1:8503',
|
||||
baseUrl: getBaseUrl(),
|
||||
api: {
|
||||
login: '/gw/login',
|
||||
getQuestion: '/user/get_question',
|
||||
answerQuestion: '/user/answer_question'
|
||||
getQuestion: '/qgdzs/get_question',
|
||||
answerQuestion: '/qgdzs/answer_question',
|
||||
getAllCategory: '/qgdzs/get_all_category'
|
||||
},
|
||||
timeout: 30000
|
||||
}
|
||||
|
||||
function getBaseUrl() {
|
||||
var baseUrl = 'http://127.0.0.1:8503'
|
||||
//#ifdef MP-WEIXIN
|
||||
const accountInfo = uni.getAccountInfoSync();
|
||||
if (accountInfo.miniProgram.envVersion == 'develop') {
|
||||
baseUrl = 'http://127.0.0.1:8503'
|
||||
}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user