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.
@@ -31436,6 +31436,7 @@ const loadJson = function (url, param, backSuccfn, async, method, headers, conte
31436
31436
  'type': method,
31437
31437
  'url': url,
31438
31438
  'data': param,
31439
+ 'timeout': 20000,
31439
31440
  'async': async
31440
31441
  };
31441
31442
  if (headers) Object.assign(ajaxContent, headers);
@@ -31451,6 +31452,7 @@ const loadJson = function (url, param, backSuccfn, async, method, headers, conte
31451
31452
 
31452
31453
  $.ajax(ajaxContent).fail(function (jqXHR, sts) {
31453
31454
  console.error('加载数据失败:' + sts + ", " + url);
31455
+ if (backSuccfn) backSuccfn(null);
31454
31456
  throw new Error('请求失败!');
31455
31457
  }).done(function (ret) {
31456
31458
  if (!ret || ret.code != 0) {
@@ -32427,19 +32429,17 @@ const deptRyOp = sip => {
32427
32429
  listIds: function (param) {
32428
32430
  let net = dept_ry_url.listOrgMemberByIdsNet;
32429
32431
  return new Promise((resolve, reject) => {
32430
- try {
32431
- loadJson(server_ + net.url, { ...param
32432
- }, function (ret) {
32432
+ loadJson(server_ + net.url, { ...param
32433
+ }, function (ret) {
32434
+ if (!ret) reject('网络连接问题');else {
32433
32435
  if (ret.code == 0) {
32434
32436
  resolve(ret);
32435
32437
  } else {
32436
32438
  console.log("多id查询成员列表失败", ret.code);
32437
32439
  reject(ret.code);
32438
32440
  }
32439
- }, '', net.method);
32440
- } catch (e) {
32441
- throw e;
32442
- }
32441
+ }
32442
+ }, '', net.method);
32443
32443
  });
32444
32444
  }
32445
32445
  };
@@ -32508,19 +32508,17 @@ const locationOp = sip => {
32508
32508
  locateDeviceByType: function (param) {
32509
32509
  let net = location_url.listTypeLocationNet;
32510
32510
  return new Promise((resolve, reject) => {
32511
- try {
32512
- loadJson(server_ + net.url, { ...param
32513
- }, function (ret) {
32511
+ loadJson(server_ + net.url, { ...param
32512
+ }, function (ret) {
32513
+ if (!ret) reject('网络连接问题');else {
32514
32514
  if (ret.code == 0) {
32515
32515
  resolve(ret);
32516
32516
  } else {
32517
32517
  console.log("获取设备信息失败", ret.code);
32518
32518
  reject(ret.code);
32519
32519
  }
32520
- }, '', net.method);
32521
- } catch (e) {
32522
- throw e;
32523
- }
32520
+ }
32521
+ }, '', net.method);
32524
32522
  });
32525
32523
  }
32526
32524
  };
Binary file