Encapsulated axios, request status is 200, but both then and catch methods are in

my_axios[method] = function (uri, data, config) {
    return new Promise(function (resolve, reject) {
      instance[method](uri, data, config)
        .then((respone) => {
          console.log("")
          if (respone.status) {
            resolve(respone);
          } else {
            if (respone.msg.match(/[0-9]+/)[0] === "302") {
              Vue.$message.error("")
              Vue.$router.push("/login")
            }
            resolve(respone);
          }
        })
        .catch((response) => {
          console.log("")
          Vue.$message.error("")
          reject(response)
        })
    })
  }

clipboard.png

Mar.14,2021

"success" can be printed, so your instance [method] this promise is resolve.

I guess: your code, resolve (.) after console.log. I made a mistake before

.

it is recommended that you print out the response in catch on the console to see if there are any errors in the logic in the above then (for example, the response in the above then is actually undefined)


emmm, this is how we seal it

  

'302' remove quotation marks

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-1b396c9-2c19c.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-1b396c9-2c19c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?