<template>
    <div class="app-container">
    </div>
</template>

<script>
    import {
        mapGetters
    } from 'vuex'
    import website from '@/config/website.js'
    export default {
        data() {
            return {}
        },
        computed: {
            ...mapGetters(['auth']),
        },
        onLoad(options) {
            uni.showLoading({
                title: ''
            })
            if (options.token) {
                const that = this
                console.log(options)
                this.$store.dispatch("LoginByUsername", {
                    username: 'admin',
                    password: "admin",
                    key: '',
                    code: '1111',
                    type: "account",
                    token: options.token,
                    tenantId: website.tenantId
                }).then((resp) => {
                    console.log('123', resp)
                    this.$store.dispatch('refreshAuthState').then(() => {
                        that.loading = false
                        var auth = this.auth
                        uni.hideLoading()
                        if (!auth.bankCardState) {
                            that.goSign(0)
                        } else {

                            uni.switchTab({
                                url: '/pages/index/index'
                            })
                        }
                    })
                }).catch((err) => {
                    this.loading = false
                    // this.$refs.code.refushCode()
                });
            } else {
                uni.reLaunch({
                    url: '/pages/login/login'
                })
            }
        },
        method: {
            callback(token) {

            }
        }
    }
</script>

<style lang="scss" scoped>
    .app-container {}
</style>