ajax asyn不起作用,async/await 多级调用后就不起作用了?

提交

export default {

methods: {

bindGetUserInfo(e) {

//省略代码 获取用户信息

this.submitForm()

},

submitForm() {

//省略代码 处理表单数据

this.login()

},

async login () {

wx.login({

success:async res => {

let code = res.code;

if (code) {

this.submitData['code'] = code

const data = await Api.Login(this.submitData); //ajax请求

if (data.errcode === 0) {

//省略

}

代码中ajax请求是在login方法中定义的,点击button调用的顺序是bindGetUserInfo -> submitForm -> login,await 却没有等待,我换成

export default {

methods: {

async bindGetUserInfo(e) {

//省略代码 获取用户信息

await this.submitForm()

},

async submitForm() {

//省略代码 处理表单数据

await this.login()

},

async login () {

wx.login({

success:async res => {

let code = res.code;

if (code) {

this.submitData['code'] = code

const data = await Api.Login(this.submitData); //ajax请求

if (data.errcode === 0) {

//省略

}

这样也不行,不知道什么原因?