From 6b02f2a6aa9761430a16e30f1047ae9104c8ac3f Mon Sep 17 00:00:00 2001 From: mhy <2624196756@qq.com> Date: Mon, 28 Oct 2024 14:46:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9E=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/core/api.ts | 60 +++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/src/services/core/api.ts b/src/services/core/api.ts index 99d9097..7c710a8 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 -- GitLab