created () {
this.init()
},
methods: {
init () {
this.getToken()
this.getData()
},
async getToken () {
let token = await postToken()
...
},
async getData () {
if(this.token) return "token no null"
let data = await postData();
....
}
}
The code is roughly the same as above, and the actual runtime always says, "token no null", has already added async await to two methods that use ajax, why is it still asynchronous?