flat: 登陆
This commit is contained in:
@@ -275,8 +275,15 @@
|
||||
swiperType:1,//轮播图类型:冀联:1、衡水3
|
||||
};
|
||||
},
|
||||
onLoad: function() {},
|
||||
onLoad: function(options) { },
|
||||
onShow: function() {
|
||||
console.log(this.$store.state.auth.loginType, 'index')
|
||||
// if(this.$store.state.auth.loginType !== 0) {
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/login/blank'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if (!this.$store.state.user.token) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
|
||||
70
pages/login/blank.vue
Normal file
70
pages/login/blank.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user