vbenjs / vue-vben-admin

A modern vue admin. It is based on Vue3, vite and TypeScript. It's fast!
https://vben.vvbin.cn/
MIT License
22.88k stars 6.24k forks source link

请求重试的时候自动删除header #3896

Closed electroluxcode closed 4 weeks ago

electroluxcode commented 1 month ago

项目中遇到了请求重试的时候headers丢失的情况,。 阅读源码发现有这一句delete config.headers; ,然后 发现是一个pr添加上去的。https://github.com/vbenjs/vue-vben-admin/pull/2416 。因为这个原因,header在第二次会丢失,而这个pr删掉headers再请求应该是比较特定的场景才会生效的方案,毕竟导致错误的情况很多,在vben作为一个通用型解决方案的条件下这个pr显得不是那么通用

https://github.com/vbenjs/vue-vben-admin/blob/4974de255338472c02511dc4a8b8acdee6c8ef60/src/utils/http/axios/axiosRetry.ts#L10-L22

wangjue666 commented 4 weeks ago

同意你的观点,这个PR的确有些莫名其妙