The result cannot be return in .then of the es6 function

export function postMethod(data) {
  const baseURL = process.env.BASE_API
  axios({
    method: "post",
    url: baseURL + "/img_upload",
    timeout: 50000,
    data: data,
    headers: {
      "loginToken": getLoginToken()
    }
  }).then(res => {
    const respose = res.data
    if (respose.errno == "success") {  //
      //console.log(respose.data)
      //******************((((((((((((((((
      return respose.data
      //******************))))))))))))))))
    } else if (respose.errno == "fail") {  //
      Message({
        message: respose.msg,
        type: "error",
        duration: 2 * 1000
      })
    } else { //
      Message({
        message: "",
        type: "error",
        duration: 2 * 1000
      })
    }
  })
}

when postMethod (data) is used elsewhere, the result is undefined.
this return doesn"t work, so how do I get the function to return the data returned when calling the interface?


export async function postMethod (data) {
    ...
    return await axios({
        ...
    }) 
}
async funcion getRes (...) { // 
    let res = await postMethod(...)
    ..... // res
}
// 
getRes(...)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e48df6-44d09.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e48df6-44d09.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?