chore: 悦码渲染器不拦截请求的响应
This commit is contained in:
@@ -72,6 +72,7 @@ const getParamsFromUrl = (): Partial<InitParams> => {
|
||||
const getInitParams = (): InitParams | null => {
|
||||
if (isWujieSubApp && window.$wujie?.props) {
|
||||
const props: WujieProps = window.$wujie.props;
|
||||
console.log('WujieProps', props);
|
||||
if (props.fileId && props.projectId) {
|
||||
console.log('使用无界初始化渲染器');
|
||||
return props as WujieProps;
|
||||
@@ -113,17 +114,17 @@ const initRequestConfig = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const mergeResponseInterceptors = () => {
|
||||
const responseHandlers = props.interceptors?.response?.handlers || [];
|
||||
responseHandlers.forEach((handler) => {
|
||||
if (isFn(handler?.fulfilled)) {
|
||||
request.useResponse(handler.fulfilled, handler.rejected);
|
||||
}
|
||||
});
|
||||
};
|
||||
// const mergeResponseInterceptors = () => {
|
||||
// const responseHandlers = props.interceptors?.response?.handlers || [];
|
||||
// responseHandlers.forEach((handler) => {
|
||||
// if (isFn(handler?.fulfilled)) {
|
||||
// request.useResponse(handler.fulfilled, handler.rejected);
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
mergeRequestInterceptors();
|
||||
mergeResponseInterceptors();
|
||||
// mergeResponseInterceptors();
|
||||
};
|
||||
|
||||
// 显示加载中
|
||||
|
||||
Reference in New Issue
Block a user