fix(cache): 修复promise模式下cache能力不生效的问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<p align="center"><img src="./image/logo.png" alt="weRequest" height="160"/></p>
|
<p align="center"><img src="./image/logo.png" alt="weRequest" height="160"/></p>
|
||||||
<h2 align="center">v1.6.0</h2>
|
<h2 align="center">v1.6.1</h2>
|
||||||
<p align="center"><b>解决繁琐的小程序会话管理,一款自带登录态管理的网络请求组件。</b></p>
|
<p align="center"><b>解决繁琐的小程序会话管理,一款自带登录态管理的网络请求组件。</b></p>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
4
build/weRequest.min.js
vendored
4
build/weRequest.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "we-request",
|
"name": "we-request",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "本工具通过拓展小程序的wx.request,让开发者通过简单的配置,实现自动管理登录态等功能",
|
"description": "本工具通过拓展小程序的wx.request,让开发者通过简单的配置,实现自动管理登录态等功能",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"登录态",
|
"登录态",
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ function responseForRequest(
|
|||||||
realData = res.data;
|
realData = res.data;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
// 缓存存储
|
||||||
|
cacheManager.set(obj, realData);
|
||||||
if (!obj.noCacheFlash) {
|
if (!obj.noCacheFlash) {
|
||||||
// 如果为了保证页面不闪烁,则不回调,只是缓存最新数据,待下次进入再用
|
// 如果为了保证页面不闪烁,则不回调,只是缓存最新数据,待下次进入再用
|
||||||
if (typeof obj.success === "function") {
|
if (typeof obj.success === "function") {
|
||||||
@@ -52,8 +54,6 @@ function responseForRequest(
|
|||||||
return realData;
|
return realData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 缓存存储
|
|
||||||
cacheManager.set(obj, realData);
|
|
||||||
} else {
|
} else {
|
||||||
// 接口返回失败码
|
// 接口返回失败码
|
||||||
throw { type: 'logic-error', res }
|
throw { type: 'logic-error', res }
|
||||||
|
|||||||
Reference in New Issue
Block a user