chore: 悦码渲染器不拦截请求的响应

This commit is contained in:
wangxuefeng
2025-03-21 18:47:44 +08:00
parent 4c59bfeb61
commit 69ccd6a48d
6 changed files with 39 additions and 15 deletions

View File

@@ -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();
};
// 显示加载中