feat: 改造入口页(自动跳转)和登录页(微信授权登录)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
37be873c3a
commit
6330edba00
+9
-21
@@ -1,16 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"
|
||||
import { onLaunch } from '@dcloudio/uni-app'
|
||||
import { useUserStore } from './store/user'
|
||||
|
||||
onLaunch(() => {
|
||||
const logs = uni.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
uni.setStorageSync('logs', logs)
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
const userStore = useUserStore()
|
||||
// 如果有 token,尝试获取用户信息
|
||||
if (userStore.isLogin) {
|
||||
userStore.fetchUserInfo().catch(() => {
|
||||
// 获取用户信息失败不影响使用
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -19,15 +18,4 @@ page {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user