<script setup>
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { store } from "@/store/index.js";

onLaunch(() => {
    // 尝试去获取本地的 token 和用户信息，填充到 store 中
    let token = uni.getStorageSync("token");
    if (token) {
        let userInfo = uni.getStorageSync("userInfo");
        if (userInfo) {
            if (userInfo.userId) {
                store.setUserInfo(userInfo);
            }
        }
    }

    // #ifdef APP-PLUS
    // initBarcodeModule();
    // #endif
});
</script>

<style lang="scss">
@import "@/uni_modules/uview-plus/index.scss";
@import "@/static/css/mystyle.css";
@import "@/static/css/common.scss";

/*每个页面公共css */
page {
    background: #f5f6fa;
    height: 100%;
}
</style>
