<script>
export default {
name: '',
data() {
return {
user:'',
id:''
}
},
props: {},
computed: {},
methods: {
},
mounted () {
new Promise(function (resolve, reject) {
axios.get('/api/extensys/exten_action.php?act=get_userinfo&unionid=oaNquuJBYcTrl4EJOXYaINXN7xZo')
.then((response) => {
this.user = response.data.userInfo
this.id = response.data.loginResult.player.userid
resolve(this.id);
})
}).then(function (id){
axios.get('/api/extensys/action.php?act=get_levelinfo&userid='+id)
.then((response) => {
console.log(response.data)
})
})
}
}
</script>
vue中Promise用法
最新推荐文章于 2024-08-14 20:35:28 发布