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

调用cacheRequest报错 #45

Closed
superlbr opened this issue May 15, 2021 · 3 comments
Closed

调用cacheRequest报错 #45

superlbr opened this issue May 15, 2021 · 3 comments

Comments

@superlbr
Copy link

Unhandled promise rejection TypeError: Cannot read property 'request' of undefined

    get(action, data, config) {
        return this.request('GET', action, data, config);
    }
@NewFuture
Copy link
Owner

不能复现,是怎么调用的?

@superlbr
Copy link
Author

那cacheRequest应该怎么调用呢

@NewFuture
Copy link
Owner

一般就和request一样调用

import { cacheRequest } from "miniprogram-network";
cacheRequest({
  url:  API,
  params: { id },
});

如果只想使用cache不使用其它库可以https://github.com/NewFuture/miniprogram-network/tree/master/cache

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