解决核心思路,增加map
Promise.all([p1, p2].map(p => p.catch(e => e)))
Promise.all([p1, p2].map(p => p.catch(e => e)))
.then(results => {
let companyResult = results[0]
let securityQuestionsResult = results[1]
if(!(companyResult instanceof Error)){
=
this.model.postalCode = companyResult.data.postCode
}
if(!(securityQuestionsResult instanceof Error)){
this.model.securityQuestionArr = securityQuestionsResult.data
}
})
.catch(e => {
this.$parent.loading = false
})
.finally(() => {
this.$parent.loading = false
})