dfws-ve-taro-request 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +13 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +13 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -6823,7 +6823,7 @@
|
|
6823
6823
|
return data;
|
6824
6824
|
}
|
6825
6825
|
var type = response.header['Content-Type'] || response.header['content-type'] || '';
|
6826
|
-
if (typeof data.status == 'undefined' && !type.includes('text/html')) {
|
6826
|
+
if (typeof data.status == 'undefined' && (type && !type.includes('text/html'))) {
|
6827
6827
|
data.status = 1;
|
6828
6828
|
data.errMsg = "";
|
6829
6829
|
}
|
@@ -6866,10 +6866,18 @@
|
|
6866
6866
|
return checkStatus(response, { url: url, data: data, method: method }, Taro);
|
6867
6867
|
}).catch(function (err) {
|
6868
6868
|
console.log('error:', err);
|
6869
|
-
|
6870
|
-
|
6871
|
-
|
6872
|
-
|
6869
|
+
if (err && err.statusCode == 401) {
|
6870
|
+
Taro.removeStorage({ key: 'ticket' });
|
6871
|
+
Taro.removeStorage({ key: 'user_id' });
|
6872
|
+
Taro.removeStorage({ key: 'openid' });
|
6873
|
+
Taro.removeStorage({ key: 'mobile' });
|
6874
|
+
}
|
6875
|
+
else {
|
6876
|
+
Taro.showToast({
|
6877
|
+
title: '网络异常,请稍后重试',
|
6878
|
+
icon: 'none',
|
6879
|
+
});
|
6880
|
+
}
|
6873
6881
|
return {
|
6874
6882
|
status: 0,
|
6875
6883
|
errMsg: '',
|