@10yun/cv-mobile-ui 0.5.6 → 0.5.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugins/request.js +11 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10yun/cv-mobile-ui",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "十云cvjs移动端ui,适用uniapp",
5
5
  "author": "",
6
6
  "license": "Apache-2.0",
@@ -13,14 +13,16 @@ function confirmEnding(str, target) {
13
13
  return false;
14
14
  }
15
15
  function _hideUniapp() {
16
- uni.hideLoading();
17
- uni.hideToast();
18
- uni.hideNavigationBarLoading();
19
- uni.stopPullDownRefresh();
16
+ try {
17
+ uni.hideToast();
18
+ uni.hideLoading();
19
+ uni.hideNavigationBarLoading();
20
+ uni.stopPullDownRefresh();
21
+ } catch (e) {}
20
22
  }
21
23
  function showErrorMsg(msg) {
22
- uni.hideLoading();
23
24
  uni.hideToast();
25
+ uni.hideLoading();
24
26
  uni.showToast({
25
27
  icon: 'none',
26
28
  duration: 2000,
@@ -165,9 +167,6 @@ class RequestClass {
165
167
  break;
166
168
  // 无效凭证,请重新登录
167
169
  case '100109':
168
-
169
-
170
-
171
170
  break;
172
171
  case '8002':
173
172
  case 8002: // uni.login 微信注册
@@ -193,7 +192,7 @@ class RequestClass {
193
192
  case '200':
194
193
  case 200:
195
194
  // if (apiResData.length == 0) {
196
- //
195
+ //
197
196
  // }
198
197
  return apiResData;
199
198
  break;
@@ -301,18 +300,18 @@ class RequestClass {
301
300
  return $requestHandle
302
301
  .then((uniRes) => {
303
302
  // uniRes 为微信返回 + 接口返回 拼接的数据
304
- if (uniRes[1].statusCode == 200) {
303
+ if (uniRes.statusCode == 200) {
305
304
  uni.hideNavigationBarLoading();
306
305
  // apiResData 为 接口返回 拼接的数据,一般 success 成功,开发者只需要 apiResData
307
306
  // let apiResData = JSON.parse(uniRes.data, true);
308
- let apiResData = uniRes[1].data || {};
307
+ let apiResData = uniRes.data || {};
309
308
 
310
309
  // upload需要json转数组
311
310
  if (type == 'upload') {
312
311
  apiResData = JSON.parse(apiResData, true);
313
312
  }
314
313
  return _this.setResponse(apiResData);
315
- } else if (uniRes[1].statusCode == 502) {
314
+ } else if (uniRes.statusCode == 502) {
316
315
  } else {
317
316
  _hideUniapp();
318
317
  if (type == 'POST') {