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

4.x前端请求参数重复 #324

Open
dhloveyou opened this issue Dec 29, 2023 · 1 comment
Open

4.x前端请求参数重复 #324

dhloveyou opened this issue Dec 29, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dhloveyou
Copy link

版本信息:

演示版本
https://datasource.tangyh.top/#/user/employee

问题描述:

请求参数重复,提交请求前是否可以做一下参数去重处理?

报错截图

image

重现步骤

  1. 访问了什么接口?
    /api/oauth/anyUser/dict/findDictMapItemListByKey
  2. 传递什么参数?
    参数重复,见截图
  3. 后端控制台报了什么错?
    没有报错
  4. 前端控制台报了什么错?
    没有报错

支持一下

如果该issue帮助了你, 麻烦给项目点个star, 并给当前issue回复一下 “👍” 或者 “已解决”.

@zuihou zuihou self-assigned this Dec 29, 2023
@zuihou zuihou added the bug Something isn't working label Dec 29, 2023
@zuihou
Copy link
Collaborator

zuihou commented Jan 7, 2024

这个问题比较棘手,目前定位到的原因如下:

  • resetSchema和updateSchema等方法调用位置
image - Api组件代码 image

resetSchema和updateSchema等方法执行后,会导致ApiSelect和ApiRadioGroup等方法初始化多次,初始化组件时,会导致组件的watchEffect和watch等方法执行多次,最终出现调用多次api接口的现象。

由于字典回显的api是经过处理过的,对于同一个接口调用多次时,会将100ms内发起的多个请求合并为一个请求,参数会累加,所以出现参数重复的情况。好在后台接口在接受到多个相同参数时,也仅会返回一次数据,所以对于普通用户来说没感觉到问题。

目前这个问题还没找到解决方案,后续解决了在回复此贴。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants