|
@@ -57,14 +57,15 @@ request.interceptors.request.use((url, options) => {
|
57
|
57
|
data,
|
58
|
58
|
requestType: data instanceof FormData ? 'form' : 'json',
|
59
|
59
|
credentials: 'include', // 带 cookie
|
60
|
|
- interceptors: true
|
|
60
|
+ interceptors: true,
|
|
61
|
+ getResponse: true
|
61
|
62
|
},
|
62
|
63
|
}
|
63
|
64
|
);
|
64
|
65
|
});
|
65
|
66
|
|
66
|
67
|
request.interceptors.response.use(async (response, options) => {
|
67
|
|
-
|
|
68
|
+
|
68
|
69
|
if (response && response.status) {
|
69
|
70
|
if (response.status != 200) {
|
70
|
71
|
const errorText = codeMessage[response.status] || response.statusText;
|