vue中axios获取到的值如何再次引用

回首过往如一梦 回首过往如一梦 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

<script>
export default {
name: '',
data() {
return {
user:'',
id:''
}
},
props: {},
computed: {},
methods: {
},
mounted () {
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
// console.log(this.id)
// console.log(this.user)
})
axios.get('/api/extensys/action.php?act=get_levelinfo&userid=')
.then((response) => {
// this.user = response.data
console.log(response.data)
})
}
}
</script>


图中第一次axios获取到的 this.id = response.data.loginResult.player.userid userid的值作为第二次 axios.get('/api/extensys/action.php?act=get_levelinfo&userid=') userid中的参数
怎么把userid的值调用
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
回首过往如一梦
JavaScript 87,984 成员 224,681 内容