JewelryMall/miniprogram/App.vue
2026-02-14 19:29:15 +08:00

27 lines
502 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script lang="ts">
import { autoLogin } from './utils/request'
export default {
onLaunch() {
console.log('App Launch')
// 检查是否已有 token没有则自动登录
const token = uni.getStorageSync('token')
if (!token) {
autoLogin().catch((err) => {
console.error('自动登录失败:', err)
})
}
},
onShow() {
console.log('App Show')
},
onHide() {
console.log('App Hide')
},
}
</script>
<style>
/* 每个页面公共 css */
</style>