feat: 优化登录流程

This commit is contained in:
2025-12-15 22:33:22 +08:00
parent 9eb1dc6747
commit 296781c506
4 changed files with 7 additions and 11 deletions

View File

@@ -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();
});

View File

@@ -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";

View File

@@ -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);
}
};

View File

@@ -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 = {