dfws-ve-taro-request 0.1.7 → 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 CHANGED
@@ -6860,10 +6860,18 @@ var request = (function (url, data, method, header, Taro, debug) {
6860
6860
  return checkStatus(response, { url: url, data: data, method: method }, Taro);
6861
6861
  }).catch(function (err) {
6862
6862
  console.log('error:', err);
6863
- Taro.showToast({
6864
- title: '网络异常,请稍后重试',
6865
- icon: 'none',
6866
- });
6863
+ if (err && err.statusCode == 401) {
6864
+ Taro.removeStorage({ key: 'ticket' });
6865
+ Taro.removeStorage({ key: 'user_id' });
6866
+ Taro.removeStorage({ key: 'openid' });
6867
+ Taro.removeStorage({ key: 'mobile' });
6868
+ }
6869
+ else {
6870
+ Taro.showToast({
6871
+ title: '网络异常,请稍后重试',
6872
+ icon: 'none',
6873
+ });
6874
+ }
6867
6875
  return {
6868
6876
  status: 0,
6869
6877
  errMsg: '',