登录组件封装
This commit is contained in:
@@ -95,11 +95,21 @@
|
||||
</view>
|
||||
</view>
|
||||
</u--form>
|
||||
<view>
|
||||
<u-overlay :show="!isLoad">
|
||||
<login @success="reOnLoad()" @fail="failToLoad()"></login>
|
||||
</u-overlay>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import login from '../my/login/login.vue'
|
||||
export default {
|
||||
components: {
|
||||
login
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabsList: [{
|
||||
@@ -134,7 +144,8 @@
|
||||
categoryPickerList: [
|
||||
['类别1', '类别', '类别']
|
||||
],
|
||||
fileList1: []
|
||||
fileList1: [],
|
||||
isLoad: true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -144,6 +155,15 @@
|
||||
} else if (options.index == 1) {
|
||||
this.tabCurrent = 1
|
||||
}
|
||||
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {
|
||||
console.log(uni.getStorageSync('token'))
|
||||
this.isLoad = false
|
||||
// uni.navigateTo({
|
||||
// url: '../../pages/my/login/login'
|
||||
// })
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
},
|
||||
methods: {
|
||||
tabChange(data) {
|
||||
@@ -230,6 +250,22 @@
|
||||
// });
|
||||
// })
|
||||
},
|
||||
reOnLoad() {
|
||||
console.log('----------------true')
|
||||
if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) {
|
||||
this.$toast.warn('登录失败请重试')
|
||||
this.isLoad = false
|
||||
// uni.navigateTo({
|
||||
// url: '../../pages/my/login/login'
|
||||
// })
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
},
|
||||
failToLoad() {
|
||||
console.log('----------------false')
|
||||
this.$toast.warn('登录失败请重试')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user