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