what - bug
项目监测报告一进入页面,点击每个板块,接口都提示缺失参数 code — 500 的错误
why - 原因
路由地址缺失 ?
<Link to={`/projectMg/monitorReport/reportDetail/1${history.location.search}`} target='*'>项目监测报告</Link>/projectMg/monitorReport/reportDetail/1?${history添加 ?后正常获取到 history 地址中的 code
_history
If the URL of your page is https://example.com/?name=Jonathan%20Smith&age=18 you could parse out the name and age parameters using:
how - 解决
定位页面
Elements - 右边箭头 - 找页面 CV - data-inspector-relative-path 中的文件地址, Com + P 可以直接打开定位到页面
console.log 页面中提示的 缺失 code
打印从 history 中获取的 code 为 undefined, 说明没获取到 code 值
打印 history 方法 查看是否使用正确,
上述说明没法获取到 code
修改 history 中 的 url, 添加了 ?后,可以获取到 code 值,页面也没有报错了
<Link to={`/projectMg/monitorReport/reportDetail/1${history.location.search}`} target='*'>项目监测报告</Link>/projectMg/monitorReport/reportDetail/1?${history添加 ?后正常获取到 history 地址中的 code
