This commit is contained in:
yanran200730
2022-11-15 14:36:28 +08:00
parent 90a06e91b6
commit 3daebc279e
2 changed files with 24 additions and 6 deletions

View File

@@ -61,8 +61,16 @@ export default {
}, },
onLoad () { onLoad () {
if (this.token) {
this.$loading()
this.getUserInfo()
this.getList()
} else {
this.autoLogin().then(() => {
this.$loading() this.$loading()
this.getList() this.getList()
})
}
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
}, },
methods: { methods: {
@@ -165,7 +173,8 @@ export default {
params: { params: {
current: this.current, current: this.current,
size: 10, size: 10,
listType: 1 listType: 1,
openId: this.user.openId
} }
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {

View File

@@ -66,8 +66,16 @@
}, },
onLoad () { onLoad () {
if (this.token) {
this.$loading()
this.getUserInfo()
this.getList()
} else {
this.autoLogin().then(() => {
this.$loading() this.$loading()
this.getList() this.getList()
})
}
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
}, },
methods: { methods: {
@@ -177,7 +185,8 @@
params: { params: {
current: this.current, current: this.current,
size: 10, size: 10,
listType: 0 listType: 0,
openId: this.user.openId
} }
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {