feat: 调整登录逻辑

This commit is contained in:
duanshuwen
2025-09-12 22:20:01 +08:00
parent 07752394eb
commit c03a4200be
12 changed files with 248 additions and 175 deletions

36
App.vue
View File

@@ -1,28 +1,8 @@
<script setup>
import { onLaunch, onShow, onHide, onLoad } from "@dcloudio/uni-app";
import { checkPhone } from "@/manager/LoginManager";
import { goLogin } from "@/hooks/useGoLogin";
import { goHome } from "@/hooks/useGoHome";
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
onLaunch(async () => {
console.log("App Launch");
const token = uni.getStorageSync("token");
// 检测是否绑定手机号和token
if (!token) {
goLogin();
return;
}
if (token) {
const res = await checkPhone();
if (res.data) {
goHome();
}
}
});
onShow(() => {
@@ -55,4 +35,18 @@ body,
.mb12 {
margin-bottom: 12px;
}
// 重置按钮样式
.reset-btn {
background: none;
border: none;
outline: none;
padding: 0;
margin: 0;
&::after {
border: none;
content: " ";
}
}
</style>