@tarojs/runtime 3.6.31 → 3.6.32-alpha.2

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.
@@ -2910,11 +2910,19 @@ const URLSearchParams = process.env.TARO_PLATFORM === 'web' ? env.window.URLSear
2910
2910
  for (let pairs = query.split('&'), i = 0, length = pairs.length; i < length; i++) {
2911
2911
  const value = pairs[i];
2912
2912
  const index = value.indexOf('=');
2913
- if (index > -1) {
2914
- appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
2913
+ // 针对不规范的 url 参数做容错处理,如:word=你%好
2914
+ try {
2915
+ if (index > -1) {
2916
+ appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
2917
+ }
2918
+ else if (value.length) {
2919
+ appendTo(dict, decode(value), '');
2920
+ }
2915
2921
  }
2916
- else if (value.length) {
2917
- appendTo(dict, decode(value), '');
2922
+ catch (err) {
2923
+ if (process.env.NODE_ENV !== 'production') {
2924
+ console.warn(`[Taro warn] URL 参数 ${value} decode 异常`);
2925
+ }
2918
2926
  }
2919
2927
  }
2920
2928
  }