ucservice 2.1.0 → 2.1.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.
@@ -31445,6 +31445,7 @@ const loadJson = function (url, param, backSuccfn, async, method, headers, conte
31445
31445
  'type': method,
31446
31446
  'url': url,
31447
31447
  'data': param,
31448
+ 'timeout': 20000,
31448
31449
  'async': async
31449
31450
  };
31450
31451
  if (headers) Object.assign(ajaxContent, headers);
@@ -31460,6 +31461,7 @@ const loadJson = function (url, param, backSuccfn, async, method, headers, conte
31460
31461
 
31461
31462
  $.ajax(ajaxContent).fail(function (jqXHR, sts) {
31462
31463
  console.error('加载数据失败:' + sts + ", " + url);
31464
+ if (backSuccfn) backSuccfn(null);
31463
31465
  throw new Error('请求失败!');
31464
31466
  }).done(function (ret) {
31465
31467
  if (!ret || ret.code != 0) {
@@ -32436,19 +32438,17 @@ const deptRyOp = sip => {
32436
32438
  listIds: function (param) {
32437
32439
  let net = dept_ry_url.listOrgMemberByIdsNet;
32438
32440
  return new Promise((resolve, reject) => {
32439
- try {
32440
- loadJson(server_ + net.url, { ...param
32441
- }, function (ret) {
32441
+ loadJson(server_ + net.url, { ...param
32442
+ }, function (ret) {
32443
+ if (!ret) reject('网络连接问题');else {
32442
32444
  if (ret.code == 0) {
32443
32445
  resolve(ret);
32444
32446
  } else {
32445
32447
  console.log("多id查询成员列表失败", ret.code);
32446
32448
  reject(ret.code);
32447
32449
  }
32448
- }, '', net.method);
32449
- } catch (e) {
32450
- throw e;
32451
- }
32450
+ }
32451
+ }, '', net.method);
32452
32452
  });
32453
32453
  }
32454
32454
  };
@@ -32517,19 +32517,17 @@ const locationOp = sip => {
32517
32517
  locateDeviceByType: function (param) {
32518
32518
  let net = location_url.listTypeLocationNet;
32519
32519
  return new Promise((resolve, reject) => {
32520
- try {
32521
- loadJson(server_ + net.url, { ...param
32522
- }, function (ret) {
32520
+ loadJson(server_ + net.url, { ...param
32521
+ }, function (ret) {
32522
+ if (!ret) reject('网络连接问题');else {
32523
32523
  if (ret.code == 0) {
32524
32524
  resolve(ret);
32525
32525
  } else {
32526
32526
  console.log("获取设备信息失败", ret.code);
32527
32527
  reject(ret.code);
32528
32528
  }
32529
- }, '', net.method);
32530
- } catch (e) {
32531
- throw e;
32532
- }
32529
+ }
32530
+ }, '', net.method);
32533
32531
  });
32534
32532
  }
32535
32533
  };
Binary file