@clownlee/http 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -172,6 +172,17 @@ async function handleResponseInterceptor(response, store, refreshConfig) {
|
|
|
172
172
|
throw new Error(responseData == null ? void 0 : responseData.message);
|
|
173
173
|
} else if (code === 2001) {
|
|
174
174
|
const config = response.config;
|
|
175
|
+
if (config._retry) {
|
|
176
|
+
window.parent.postMessage({
|
|
177
|
+
type: "error",
|
|
178
|
+
data: JSON.stringify({
|
|
179
|
+
code: responseData == null ? void 0 : responseData.code,
|
|
180
|
+
message: responseData == null ? void 0 : responseData.message,
|
|
181
|
+
action: "toLogin"
|
|
182
|
+
})
|
|
183
|
+
}, "*");
|
|
184
|
+
throw new Error(responseData == null ? void 0 : responseData.message);
|
|
185
|
+
}
|
|
175
186
|
if (!refreshConfig || !store) {
|
|
176
187
|
return response;
|
|
177
188
|
}
|