From 296781c506adee1fdd0c4b56e4b3a09a84447c09 Mon Sep 17 00:00:00 2001 From: zoujing Date: Mon, 15 Dec 2025 22:33:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 ++-- src/pages/login/index.vue | 2 +- src/request/api/config.js | 11 ++++------- src/request/base/request.js | 1 - 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/App.vue b/src/App.vue index 946bdd9..cf607db 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,8 +3,8 @@ import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"; import { getEvnUrl } from "@/request/api/config"; import { refreshToken } from "@/hooks/useGoLogin"; -onLaunch(() => { - getEvnUrl({ versionValue: "1.0.2" }); +onLaunch(async () => { + await getEvnUrl({ versionValue: "1.0.3" }); refreshToken(); }); diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index bdea3e6..a2eb133 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -64,7 +64,7 @@ import { getServiceAgreement, getPrivacyAgreement, } from "@/request/api/LoginApi"; -import { onLogin, goBack, loginAuth, refreshToken } from "@/hooks/useGoLogin"; +import { onLogin, goBack, refreshToken } from "@/hooks/useGoLogin"; import CheckBox from "@/components/CheckBox/index.vue"; import AgreePopup from "./components/AgreePopup/index.vue"; import { zniconsMap } from "@/static/fonts/znicons.js"; diff --git a/src/request/api/config.js b/src/request/api/config.js index 7512b37..5f60bb0 100644 --- a/src/request/api/config.js +++ b/src/request/api/config.js @@ -3,14 +3,11 @@ import { isProd } from "@/constant/base"; import { useAppStore } from "@/store"; // 获取服务地址 -const getEvnUrl = (args) => { - if (isProd) { +const getEvnUrl = async (args) => { + const res = await request.post("https://biz.nianxx.cn/hotelBiz/mainScene/getServiceUrl", args) + if (res && res.code == 0 && res.data) { const appStore = useAppStore(); - request - .post("https://biz.nianxx.cn/hotelBiz/mainScene/getServiceUrl", args) - .then(({ data }) => { - appStore.setServerConfig(data); - }); + appStore.setServerConfig(res.data); } }; diff --git a/src/request/base/request.js b/src/request/base/request.js index ce9f1bc..8a8000f 100644 --- a/src/request/base/request.js +++ b/src/request/base/request.js @@ -3,7 +3,6 @@ import { getCurrentConfig } from "@/constant/base"; import { useAppStore } from "@/store"; import { NOTICE_EVENT_LOGOUT } from "@/constant/constant"; import { getStorageSyncToken } from "@/constant/token"; -import { removeStorageSyncToken } from "@/constant/token"; const clientId = getCurrentConfig().clientId; const defaultConfig = {