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

BUG及建议 #83

Open
qcks opened this issue Mar 22, 2021 · 2 comments
Open

BUG及建议 #83

qcks opened this issue Mar 22, 2021 · 2 comments

Comments

@qcks
Copy link

qcks commented Mar 22, 2021

缓存管理做单例;
bug太多,清除缓存无效;
考虑同一接口,不同用户登录情况;Token都在header里面

@franticn
Copy link
Collaborator

franticn commented Apr 4, 2021

你好,请问下清除缓存无效这个bug是怎么发生的? 能在example里面复现吗?

@qcks
Copy link
Author

qcks commented Apr 6, 2021

你好,请问下清除缓存无效这个bug是怎么发生的? 能在example里面复现吗?

为 dio 添加拦截器:

dio.interceptors.add(DioCacheManager(CacheConfig(baseUrl: "http://www.google.com")).interceptor);
为需要缓存的请求添加 options:

Dio().get(
"http://www.google.com",
options: buildCacheOptions(Duration(days: 7)),
);

3 _dioCacheManager.clearAll();
文档如是。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants