| xqd
@@ -138,7 +138,8 @@ export default {
|
|
|
title: '用户信息获取',
|
|
|
nickname: '',
|
|
|
avatar: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ btnLock: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
| xqd
@@ -205,6 +206,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleGetUserInfo(res) {
|
|
|
+ if (this.btnLock) return
|
|
|
+ this.btnLock = true
|
|
|
// #ifdef MP-KUAISHOU
|
|
|
this.$loading('数据刷新中...')
|
|
|
uni.authorize({
|
| xqd
@@ -221,15 +224,24 @@ export default {
|
|
|
code: code
|
|
|
}
|
|
|
this.$api.user.update(params).then(res => {
|
|
|
+ this.btnLock = false
|
|
|
this.code = null
|
|
|
this.$hideLoading()
|
|
|
this.$store.dispatch('user/info', res.data)
|
|
|
}).catch(() => {
|
|
|
+ this.code = null
|
|
|
+ this.btnLock = false
|
|
|
this.$hideLoading()
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ this.btnLock = false
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ this.btnLock = false
|
|
|
}
|
|
|
})
|
|
|
// #endif
|
| xqd
@@ -245,19 +257,25 @@ export default {
|
|
|
}
|
|
|
this.$loading('数据刷新中...')
|
|
|
this.$api.user.update(params).then(res => {
|
|
|
+ this.btnLock = false
|
|
|
this.code = null
|
|
|
this.$hideLoading()
|
|
|
this.$store.dispatch('user/info', res.data)
|
|
|
}).catch(() => {
|
|
|
+ this.code = null
|
|
|
+ this.btnLock = false
|
|
|
this.$hideLoading()
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ this.btnLock = false
|
|
|
}
|
|
|
})
|
|
|
// #endif
|
|
|
},
|
|
|
getCode() {
|
|
|
- return new Promise(resolve => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
if (this.code) {
|
|
|
return resolve(this.code)
|
|
|
}
|
| xqd
@@ -270,6 +288,10 @@ export default {
|
|
|
this.code = null
|
|
|
}, 1000 * 4 * 60)
|
|
|
resolve(this.code)
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ this.btnLock = false
|
|
|
+ reject()
|
|
|
}
|
|
|
})
|
|
|
})
|