feat: 调整登录逻辑

This commit is contained in:
duanshuwen committed 2025-08-05 18:37:38 +08:00
1 parent 0a15c0dac3
commit 931511b0cf
2 files changed
+8

No files matched your search

+7
View File
@@ -1,6 +1,7 @@
<script setup> <script setup>
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"; import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { checkPhone } from "@/manager/LoginManager"; import { checkPhone } from "@/manager/LoginManager";
import { goLogin } from "@/hooks/useGoLogin";
import { goHome } from "@/hooks/useGoHome"; import { goHome } from "@/hooks/useGoHome";
onLaunch(async () => { onLaunch(async () => {
@@ -9,6 +10,12 @@ onLaunch(async () => {
const token = uni.getStorageSync("token"); const token = uni.getStorageSync("token");
// 检测是否绑定手机号和token // 检测是否绑定手机号和token
if (!token) {
goLogin();
return;
}
if (token) { if (token) {
const res = await checkPhone(); const res = await checkPhone();
+1
View File
@@ -0,0 +1 @@
export const goLogin = () => uni.reLaunch({ url: "/pages/login/index" });