-
Notifications
You must be signed in to change notification settings - Fork 11
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
拦截器 #2
Comments
想要的效果是怎样的?是每个 api 一个拦截器吗? |
每个都有当然更好了..不过获取设备信息之类的拦截器好像没啥用.但是像关于视图和请求的就有必要了像.request,upload, showModal .showtoast 之类的 |
showModal 的拦截器是想类似这么用? Megalo.showToast.params.use(({ message, duration = 1000 }) => {
return {
message: `wrap [${message}]`,
duration,
}
}) |
对.在方法使用之前或者之后又公共的处理,,, |
其实就是加 aop 模式,before,after。 |
嗯. 有这样的需求.before 传入token ,加上loading, 改变颜色什么的.一次就行.不然每次用的时候都需要传入重复的值 |
其实可以考虑写一个全局方法,调用的时候用自己的全局方法 |
zhuping
pushed a commit
that referenced
this issue
Mar 13, 2019
have supported request interceptors #12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
应该支持拦截器.比较方便多地方用同样参数的方法.
The text was updated successfully, but these errors were encountered: