diff --git a/src/services/core/api.ts b/src/services/core/api.ts index 99d9097a03e8922954641c69a3f9930d74540a7e..7c710a8f8cafc21b258c03d03decd6a0a57b57b0 100644 --- a/src/services/core/api.ts +++ b/src/services/core/api.ts @@ -1,24 +1,40 @@ -// 测试/本地 -export default { - dev: "http://171.217.92.33:33011", - uploadUrl: "http://171.217.92.33:33011/oss/upload?bucketName=cgtf", - loginDev: "http://171.217.92.33:21601", - authenticationUrl: "http://171.217.92.33:21601/violating-subject/", - reportUrl: "https://xct.cdhncy.cn/citizen-voice", - assetsUrl: "https://xct.cdhncy.cn/file", - kitchenWasteUrl: "http://171.217.92.33:21601/waste", - eventUrl: "https://xct.cdhncy.cn", -}; +import Taro from "@tarojs/taro"; +const { miniProgram: { envVersion } } = Taro.getAccountInfoSync(); +let urls = {} +if (envVersion === 'develop') { // 开发版(开发者工具、预览码、提审时审查人员看到的) + urls = { + dev: "https://xct.cdhncy.cn", + uploadUrl: "https://xct.cdhncy.cn/oss/upload?bucketName=cgtf", + loginDev: "https://xct.cdhncy.cn", + authenticationUrl: "https://xct.cdhncy.cn/violating-subject/", + reportUrl: "https://xct.cdhncy.cn/citizen-voice", + assetsUrl: "https://xct.cdhncy.cn/file", + kitchenWasteUrl: "https://xct.cdhncy.cn/waste", + eventUrl: "https://xct.cdhncy.cn", + } +} else if (envVersion === 'trial') { // 体验版(体验码) + urls = { + dev: "https://xct.cdhncy.cn", + uploadUrl: "https://xct.cdhncy.cn/oss/upload?bucketName=cgtf", + loginDev: "https://xct.cdhncy.cn", + authenticationUrl: "https://xct.cdhncy.cn/violating-subject/", + reportUrl: "https://xct.cdhncy.cn/citizen-voice", + assetsUrl: "https://xct.cdhncy.cn/file", + kitchenWasteUrl: "https://xct.cdhncy.cn/waste", + eventUrl: "https://xct.cdhncy.cn", + } +} else { // 正式版(发布后) 新都正式服务 + urls = { + dev: "https://api.xinducg.cn", + uploadUrl: "https://xinducg.cn/citizen-voice/oss/upload", + loginDev: "https://api.xinducg.cn", + authenticationUrl: "https://api.xinducg.cn/violating-subject", + reportUrl: "https://api.xinducg.cn/citizen-voice", + assetsUrl: "https://xinducg.cn/file", + kitchenWasteUrl: "https://api.xinducg.cn/waste", + eventUrl: "https://api.xinducg.cn", + } +} -// 新都正式 -// export default { -// dev: "https://api.xinducg.cn", -// uploadUrl: "https://xinducg.cn/citizen-voice/oss/upload", -// loginDev: "https://api.xinducg.cn", -// authenticationUrl: "https://api.xinducg.cn/violating-subject", -// reportUrl: "https://api.xinducg.cn/citizen-voice", -// assetsUrl: "https://xinducg.cn/file", -// kitchenWasteUrl: "https://api.xinducg.cn/waste", -// eventUrl: "https://api.xinducg.cn", -// }; \ No newline at end of file +export default urls \ No newline at end of file