调试
This commit is contained in:
@@ -15,6 +15,7 @@ const request = config => {
|
||||
}
|
||||
console.log(getToken());
|
||||
// get请求映射params参数
|
||||
console.log(config.params);
|
||||
if (config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params)
|
||||
url = url.slice(0, -1)
|
||||
@@ -29,6 +30,7 @@ const request = config => {
|
||||
header: config.header,
|
||||
dataType: 'json'
|
||||
}).then(response => {
|
||||
console.log(response);
|
||||
let [error, res] = response
|
||||
if (error) {
|
||||
toast('后端接口连接异常')
|
||||
@@ -36,7 +38,7 @@ const request = config => {
|
||||
return
|
||||
}
|
||||
const code = res.data.code || 200
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
const msg = errorCode[code] || res.data.message || res.data.msg || errorCode['default']
|
||||
if (code === 401 || code === 402) {
|
||||
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||
if (res.confirm) {
|
||||
|
||||
Reference in New Issue
Block a user