Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过config动态设置requestHandlersMap,未能生效 #2234

Closed
MrLiangLong opened this issue Jun 29, 2023 · 4 comments
Closed

通过config动态设置requestHandlersMap,未能生效 #2234

MrLiangLong opened this issue Jun 29, 2023 · 4 comments
Assignees
Labels
help wanted Extra attention is needed / 老铁,赚 PR 的机会来了

Comments

@MrLiangLong
Copy link
Contributor

详细描述 bug

需求是这样的,需要满足用户自定义配置请求库的行为,如axios的响应拦截器行为,那么需要进行如下操作:

config.set("requestHandlersMap", {
  ...config.get('requestHandlersMap'),
  xxxHttp: xxxHttpHandler({
    // 用户自定义行为
 })
})

设置完成后,config.onGot("requestHandlersMap", () => {})能监听到变化行为,但实际数据源发起的请求还是走旧的处理函数。


如何复现 bug?

必现

@liujuping
Copy link
Collaborator

目前缺少监听 requestHandlersMap config 更新的逻辑。如果有需要,可以参考 locale config 更新的逻辑,提 PR 帮助我们完善这一部分。

https://github.com/alibaba/lowcode-engine/blob/main/packages/plugin-designer/src/index.tsx#L65

@liujuping liujuping added the help wanted Extra attention is needed / 老铁,赚 PR 的机会来了 label Jul 3, 2023
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Hello @MrLiangLong. We totally like your proposal/feedback, PR wanted。

你好 @MrLiangLong,我们完全同意你的提议/反馈,欢迎 PR。

@MrLiangLong
Copy link
Contributor Author

老板,已提pr。2255

@liujuping
Copy link
Collaborator

PR 已经合并了,这个 issue 先关掉了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed / 老铁,赚 PR 的机会来了
Projects
None yet
Development

No branches or pull requests

2 participants