|
@@ -33,8 +33,8 @@ const request = config => {
|
|
header: config.headers,
|
|
header: config.headers,
|
|
dataType: 'json'
|
|
dataType: 'json'
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- const code = res.data.code || 200;
|
|
|
|
- const msg = errorCode[code] || res.data.msg || errorCode['default'];
|
|
|
|
|
|
+ const code = res.data.code || 0;
|
|
|
|
+ const msg = errorCode[code] || res.data.message || errorCode['default'];
|
|
if (code === 401) {
|
|
if (code === 401) {
|
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
@@ -47,7 +47,7 @@ const request = config => {
|
|
} else if (code === 500) {
|
|
} else if (code === 500) {
|
|
toast(msg);
|
|
toast(msg);
|
|
reject('500');
|
|
reject('500');
|
|
- } else if (code !== 200) {
|
|
|
|
|
|
+ } else if (code !== 0) {
|
|
toast(msg);
|
|
toast(msg);
|
|
reject(code);
|
|
reject(code);
|
|
}
|
|
}
|