// 工具类标签:200,axios,return,res,中得,404,const,message,224 From: https://blog.51cto.com/u_15460007/6050154
// 返回请求结果
export const returnMsg = async promise => {
try {
const res = await promise
if (res.status === 200) {
return res.data
} else {
return 'no 200 !'
}
} catch (e) {
console.log(e.name + '====' + e.message)
if (e.message.indexOf('404') !== -1) {
return '404'
}
return 'error'
}
}