We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Mock-Server在处理请求过来的路由时, responseFake中使用的正则表达式,会优先匹配较短的路径, 使得长路径无法进入, 全部被短路径拦截
url: new RegExp(`${process.env.VUE_APP_BASE_API}${*url*}`),
[ {type:'get',url:'/v1/weath'}, {type:'get',url:'/v1/weather'}, ]
/v1/weather/realtime
/v1/weath
mock中两条路径
请求长路径, 返回短路径
目前的这种正则匹配, 甚至会把诸如/v1/weahter/realtime /v1/weather/forecast等路径全部拦截, 这个问题的原因和解决方法在#2385 这里就有, 我这里算是重复提交
/v1/weahter/realtime
/v1/weather/forecast
我以为这是个实际使用中很容易被发现的问题,但那个issue没有人回复和处理, 鉴于我主要工作是嵌入式C,前端只是业余了解,所以不确定是不是说API不能这样设计, 所以不会碰到这情况?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug report(问题描述)
Mock-Server在处理请求过来的路由时, responseFake中使用的正则表达式,会优先匹配较短的路径, 使得长路径无法进入, 全部被短路径拦截
Steps to reproduce(问题复现步骤)
/v1/weather/realtime
对应的API请求, 返回的数据却是短路径/v1/weath
的Mock数据Screenshot or Gif(截图或动态图)
mock中两条路径
请求长路径, 返回短路径
Link to minimal reproduction(最小可在线还原demo)
Other relevant information(格外信息)
目前的这种正则匹配, 甚至会把诸如
/v1/weahter/realtime
/v1/weather/forecast
等路径全部拦截, 这个问题的原因和解决方法在#2385 这里就有, 我这里算是重复提交我以为这是个实际使用中很容易被发现的问题,但那个issue没有人回复和处理, 鉴于我主要工作是嵌入式C,前端只是业余了解,所以不确定是不是说API不能这样设计, 所以不会碰到这情况?
The text was updated successfully, but these errors were encountered: