@xingm/http-request-sdk 0.1.4 → 0.1.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"create-request-sdk.d.ts","sourceRoot":"","sources":["../src/create-request-sdk.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EASV,UAAU,EACV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,2BAA2B,2CACE,CAAC;AAK3C,eAAO,MAAM,gBAAgB,GAAI,SAAS,GAAG,OAAO,EAClD,UAAS,iBAAiB,CAAC,SAAS,CAAM,KACzC,UAwgBF,CAAC"}
1
+ {"version":3,"file":"create-request-sdk.d.ts","sourceRoot":"","sources":["../src/create-request-sdk.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EASV,UAAU,EACV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,2BAA2B,2CACE,CAAC;AAK3C,eAAO,MAAM,gBAAgB,GAAI,SAAS,GAAG,OAAO,EAClD,UAAS,iBAAiB,CAAC,SAAS,CAAM,KACzC,UA6gBF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import O from "axios";
2
- const V = "System error", W = {
2
+ const J = "System error", K = {
3
3
  400: "Invalid request parameters",
4
4
  401: "Unauthorized. Token, username, or password is incorrect.",
5
5
  403: "Access is forbidden.",
@@ -67,8 +67,8 @@ const V = "System error", W = {
67
67
  701024: "Device detection range is invalid.",
68
68
  701025: "Failed to convert drone reported video.",
69
69
  701026: "Failed to save trajectory data.",
70
- 701027: "Drone [{}] whitelist data has expired and cannot be modified.",
71
- 701028: "Drone [{}] whitelist data has overlapping time and cannot be added.",
70
+ 701027: "Whitelist data has expired and cannot be modified.",
71
+ 701028: "Whitelist data has overlapping time and cannot be added.",
72
72
  701029: "Seconds cannot be negative.",
73
73
  701030: "Start time is empty.",
74
74
  701031: "End time is empty.",
@@ -234,8 +234,8 @@ const V = "System error", W = {
234
234
  1500000013: "payloadTransformScript length cannot exceed {} characters.",
235
235
  1500000014: "payloadTransformScript compilation failed: {}",
236
236
  1500000015: "Invalid brokerUrl format. Use mqtt://host:port, mqtts://host:port, tcp://host:port, or ssl://host:port.",
237
- other: V
238
- }, J = "系统异常", K = {
237
+ other: J
238
+ }, Y = "系统异常", X = {
239
239
  400: "参数错误",
240
240
  401: "用户没有权限(令牌、用户名、密码错误)!",
241
241
  403: "用户得到授权,但是访问是被禁止的。!",
@@ -303,8 +303,8 @@ const V = "System error", W = {
303
303
  701024: "设备侦测范围非法",
304
304
  701025: "无人机上报视频转换失败",
305
305
  701026: "轨迹数据保存失败",
306
- 701027: "无人机[{}]白名单数据已失效, 禁止修改",
307
- 701028: "无人机[{}]白名单数据已存在时间交叉, 禁止新增",
306
+ 701027: "白名单数据已失效, 禁止修改",
307
+ 701028: "白名单数据已存在时间交叉, 禁止新增",
308
308
  701029: "秒数不能为负数",
309
309
  701030: "有效时间起为空",
310
310
  701031: "有效时间止为空",
@@ -313,7 +313,7 @@ const V = "System error", W = {
313
313
  701034: "有效时间起止相同",
314
314
  701035: "构建无人机预警数据异常",
315
315
  701036: "保存无人机数据失败",
316
- 701037: "固件文件访问URL不存在, 固件ID[{}]",
316
+ 701037: "固件文件访问URL不存在",
317
317
  701038: "没有找到对应设备型号的设备,无法下发固件升级命令",
318
318
  701039: "设备固件发布状态为空",
319
319
  701040: "区域名称已存在",
@@ -588,8 +588,8 @@ const V = "System error", W = {
588
588
  1500000013: "payloadTransformScript 长度不能超过 {} 字符",
589
589
  1500000014: "payloadTransformScript 编译失败:{}",
590
590
  1500000015: "brokerUrl 格式非法,需使用 mqtt://host:port、mqtts://host:port、tcp://host:port 或 ssl://host:port",
591
- other: J
592
- }, Y = [0, 200], X = {
591
+ other: Y
592
+ }, Z = [0, 200], e0 = {
593
593
  "api.accountExpired": "Your account has expired. Please log in again.",
594
594
  "api.permissionExpiredTitle": "Permission expired",
595
595
  "api.permissionExpiredContent": "Your account has expired. Please log in again.",
@@ -599,26 +599,30 @@ const V = "System error", W = {
599
599
  "api.noPermissionOperation": "No permission to perform this operation",
600
600
  "api.exportFailed": "Export failed",
601
601
  "api.tokenExpired": "Your account has expired. Please log in again."
602
- }, Q = (e, t, n) => Z(n) ? X[e] ?? t ?? e : t ?? e, Z = (e) => typeof e == "string" && e.toLowerCase().startsWith("en"), e0 = (e) => {
603
- var o, u, c;
602
+ }, $ = (e, t, n) => t0(n) ? e0[e] ?? t ?? e : t ?? e, t0 = (e) => typeof e == "string" && e.toLowerCase().startsWith("en"), r0 = (e) => {
603
+ var o, u, d;
604
604
  if (typeof e != "string") return;
605
- const t = ((o = e.match(/【([^】]+)】/)) == null ? void 0 : o[1]) || ((u = e.match(/\(([^)]+)\)/)) == null ? void 0 : u[1]), n = (c = e.match(/原因[::]\s*(.+)$/)) == null ? void 0 : c[1], i = {};
605
+ const t = ((o = e.match(/【([^】]+)】/)) == null ? void 0 : o[1]) || ((u = e.match(/\(([^)]+)\)/)) == null ? void 0 : u[1]), n = (d = e.match(/原因[::]\s*(.+)$/)) == null ? void 0 : d[1], i = {};
606
606
  return t && (i.value = t), n && (i.reason = n), Object.keys(i).length ? i : void 0;
607
- }, t0 = (e, t) => (n, i, o) => {
608
- var c;
609
- const u = (c = e == null ? void 0 : e.translate) == null ? void 0 : c.call(e, n, i, o);
610
- return u && u !== n ? u : Q(n, i, t);
607
+ }, a0 = (e, t) => (n, i, o) => {
608
+ var d;
609
+ const u = (d = e == null ? void 0 : e.translate) == null ? void 0 : d.call(e, n, i, o);
610
+ return u && u !== n ? u : $(n, i, t);
611
611
  }, N = (e, t, n, i) => {
612
- var x, w;
613
- const u = `api.errMsg${String(e ?? "")}`, c = (x = n == null ? void 0 : n.translate) == null ? void 0 : x.call(n, u, void 0, e0(t));
614
- return c && c !== u ? c : typeof t == "string" && t || ((w = n == null ? void 0 : n.translate) == null ? void 0 : w.call(n, "api.systemException", "系统异常")) || Q("api.systemException", "系统异常", i);
615
- }, r0 = (e, t, n = "/admin-api") => typeof e == "function" ? e(t) : e ?? `${n}/system/auth/refresh-token?refreshToken=${t ?? ""}`, a0 = (e) => typeof e == "function" ? e() : e ?? "/login", H = (e, t = Y) => t.some((n) => String(n) === String(e)), n0 = (e, t = "Bearer") => typeof t == "function" ? t(e) : t ? `${t} ${e}` : e, I = () => typeof window < "u" && typeof document < "u", i0 = "http-request-sdk:authorization-expired", z = K, _ = W, s0 = (e = {}) => {
616
- const t = t0(e.locale, e.lang);
612
+ var T, w;
613
+ const u = `api.errMsg${String(e ?? "")}`, d = (T = n == null ? void 0 : n.translate) == null ? void 0 : T.call(n, u, void 0, r0(t));
614
+ return d && d !== u ? d : typeof t == "string" && t || ((w = n == null ? void 0 : n.translate) == null ? void 0 : w.call(n, "api.systemException", "系统异常")) || $("api.systemException", "系统异常", i);
615
+ }, n0 = (e, t, n = "/admin-api") => typeof e == "function" ? e(t) : e ?? `${n}/system/auth/refresh-token?refreshToken=${t ?? ""}`, i0 = (e) => typeof e == "function" ? e() : e ?? "/login", G = (e, t = Z) => t.some((n) => String(n) === String(e)), s0 = (e, t = "Bearer") => typeof t == "function" ? t(e) : t ? `${t} ${e}` : e, A = () => typeof window < "u" && typeof document < "u", o0 = "http-request-sdk:authorization-expired", U = X, _ = K, c0 = (e = {}) => {
616
+ var L;
617
+ const t = a0(e.locale, e.lang);
617
618
  let n = !1, i = null;
618
619
  const o = O.create({
619
620
  baseURL: e.baseURL ?? "/admin-api",
620
621
  timeout: e.timeout ?? 3e4,
621
622
  validateStatus: (a) => a >= 200 && a < 300 || a === 400,
623
+ paramsSerializer: ((L = e.axiosConfig) == null ? void 0 : L.paramsSerializer) ?? {
624
+ indexes: !0
625
+ },
622
626
  headers: {
623
627
  "Content-Type": "application/json;charset=UTF-8"
624
628
  },
@@ -632,15 +636,15 @@ const V = "System error", W = {
632
636
  hasToken: !!s,
633
637
  tokenLength: (s == null ? void 0 : s.length) ?? 0
634
638
  }), s;
635
- }, c = (a, r) => {
639
+ }, d = (a, r) => {
636
640
  console.info("[http-request-sdk][token]", a, {
637
641
  hasToken: !!r,
638
642
  tokenLength: (r == null ? void 0 : r.length) ?? 0
639
643
  });
640
- }, x = () => {
644
+ }, T = () => {
641
645
  var a, r, s;
642
646
  return ((a = e.getLocale) == null ? void 0 : a.call(e)) ?? ((s = (r = e.locale) == null ? void 0 : r.getLocale) == null ? void 0 : s.call(r));
643
- }, w = () => x() ?? e.lang, g = (a, r) => C(a, r, w()), D = (a) => {
647
+ }, w = () => T() ?? e.lang, g = (a, r) => C(a, r, w()), S = (a) => {
644
648
  var r;
645
649
  (r = e.onBusinessError) == null || r.call(e, a);
646
650
  }, E = (a) => {
@@ -651,7 +655,7 @@ const V = "System error", W = {
651
655
  (s = (r = e.ui) == null ? void 0 : r.error) == null || s.call(r, a);
652
656
  }, f = (a, r) => {
653
657
  console.info("[http-request-sdk][permission-expired]", a, r ?? {});
654
- }, v = () => t("api.accountExpired", "您的账号已失效,请重新登录"), T = async (a) => {
658
+ }, v = () => t("api.accountExpired", "您的账号已失效,请重新登录"), x = async (a) => {
655
659
  var y, p;
656
660
  const r = {
657
661
  ...a,
@@ -673,13 +677,13 @@ const V = "System error", W = {
673
677
  code: r.code
674
678
  });
675
679
  }, h = async () => {
676
- var l, m, d, b;
680
+ var l, m, c, b;
677
681
  f("modal:onOk:start", {
678
682
  code: r.code,
679
683
  hasOnTokenExpired: !!e.onTokenExpired
680
684
  });
681
685
  try {
682
- e.onTokenExpired ? await e.onTokenExpired(r) : (await ((m = (l = e.token) == null ? void 0 : l.logout) == null ? void 0 : m.call(l)), (b = (d = e.token) == null ? void 0 : d.clearToken) == null || b.call(d), I() && (window.location.href = a0(e.loginUrl))), s(), f("modal:onOk:success", {
686
+ e.onTokenExpired ? await e.onTokenExpired(r) : (await ((m = (l = e.token) == null ? void 0 : l.logout) == null ? void 0 : m.call(l)), (b = (c = e.token) == null ? void 0 : c.clearToken) == null || b.call(c), A() && (window.location.href = i0(e.loginUrl))), s(), f("modal:onOk:success", {
683
687
  code: r.code
684
688
  });
685
689
  } catch (M) {
@@ -703,7 +707,7 @@ const V = "System error", W = {
703
707
  });
704
708
  return;
705
709
  }
706
- if (I()) {
710
+ if (A()) {
707
711
  f("modal:adapter-missing:native-alert", {
708
712
  code: r.code
709
713
  }), window.alert(
@@ -716,108 +720,108 @@ ${r.message}`
716
720
  f("modal:adapter-missing:run-onOk-without-browser", {
717
721
  code: r.code
718
722
  }), await h();
719
- }, S = (a) => {
723
+ }, R = (a) => {
720
724
  var r, s, h, y, p;
721
725
  if (a)
722
726
  return a.accessToken && ((s = (r = e.token) == null ? void 0 : r.setToken) == null || s.call(r, a.accessToken)), a.refreshToken && ((y = (h = e.token) == null ? void 0 : h.setRefreshToken) == null || y.call(h, a.refreshToken)), (p = e.onRefreshTokenSuccess) == null || p.call(e, a), a.loginInfo;
723
- }, R = async () => {
724
- var h, y, p, l, m, d;
727
+ }, D = async () => {
728
+ var h, y, p, l, m, c;
725
729
  if (e.refreshAccessToken) {
726
730
  const b = (y = (h = e.token) == null ? void 0 : h.getRefreshToken) == null ? void 0 : y.call(h);
727
- c("refresh-token:custom-get-refresh-token", b);
731
+ d("refresh-token:custom-get-refresh-token", b);
728
732
  const M = await e.refreshAccessToken({
729
733
  refreshToken: b,
730
734
  service: o
731
735
  });
732
- return S(M);
736
+ return R(M);
733
737
  }
734
738
  const a = (l = (p = e.token) == null ? void 0 : p.getRefreshToken) == null ? void 0 : l.call(p);
735
- c("refresh-token:get-refresh-token", a);
739
+ d("refresh-token:get-refresh-token", a);
736
740
  const r = await O.post(
737
- r0(
741
+ n0(
738
742
  e.refreshTokenUrl,
739
743
  a,
740
744
  e.baseURL ?? "/admin-api"
741
745
  ),
742
746
  void 0,
743
747
  {
744
- headers: h0(e.headers)
748
+ headers: p0(e.headers)
745
749
  }
746
- ), s = ((d = (m = e.token) == null ? void 0 : m.normalizeRefreshResponse) == null ? void 0 : d.call(m, r)) ?? o0(r);
750
+ ), s = ((c = (m = e.token) == null ? void 0 : m.normalizeRefreshResponse) == null ? void 0 : c.call(m, r)) ?? d0(r);
747
751
  if (s.code === 401 || s.code === 400)
748
752
  throw new Error(v());
749
- return S(s);
750
- }, $ = () => (i || (i = R().finally(() => {
753
+ return R(s);
754
+ }, V = () => (i || (i = D().finally(() => {
751
755
  i = null;
752
756
  })), i);
753
757
  o.interceptors.request.use(
754
758
  (a) => {
755
759
  const r = u();
756
- c("request:get-access-token", r);
757
- const s = x();
758
- return r && F(
760
+ d("request:get-access-token", r);
761
+ const s = T();
762
+ return a.params = z(a.params), r && F(
759
763
  a,
760
764
  e.authHeaderName ?? "Authorization",
761
- n0(r, e.authScheme)
762
- ), s && F(a, e.localeHeaderName ?? "Accept-Language", s), m0(a, e.headers), a;
765
+ s0(r, e.authScheme)
766
+ ), s && F(a, e.localeHeaderName ?? "Accept-Language", s), f0(a, e.headers), a;
763
767
  },
764
768
  (a) => {
765
769
  var r;
766
770
  return (r = e.onRequestError) == null || r.call(e, a), Promise.reject(a);
767
771
  }
768
772
  );
769
- const G = (async (a) => {
773
+ const W = (async (a) => {
770
774
  var m;
771
775
  if (a.config.responseType === "blob")
772
- return d0(a, e, t);
776
+ return l0(a, e, t);
773
777
  if (a.status !== 200 && a.status !== 400) {
774
- const d = g(
778
+ const c = g(
775
779
  (m = a.data) == null ? void 0 : m.code,
776
780
  t("api.networkExceptionMsg", "网络连接异常")
777
781
  );
778
- return k(d), E({ message: d, response: a }), Promise.reject(new Error(d));
782
+ return k(c), E({ message: c, response: a }), Promise.reject(new Error(c));
779
783
  }
780
784
  const { code: r, msg: s, message: h, data: y } = a.data, l = s || h || t("api.systemException", "系统异常");
781
785
  if (Number(r) === 400) {
782
- const d = v();
786
+ const c = v();
783
787
  return f("response:code-400:show-modal", {
784
788
  httpStatus: a.status,
785
789
  code: r,
786
- message: d,
790
+ message: c,
787
791
  url: a.config.url
788
- }), await T({ code: r, message: d, response: a }), D({ code: r, message: d, response: a }), Promise.reject(new Error(d));
792
+ }), await x({ code: r, message: c, response: a }), S({ code: r, message: c, response: a }), Promise.reject(new Error(c));
789
793
  }
790
- if (f0(a, e)) {
794
+ if (g0(a, e)) {
791
795
  f("response:should-refresh-token", {
792
796
  httpStatus: a.status,
793
797
  code: r,
794
798
  message: l,
795
799
  url: a.config.url
796
800
  });
797
- const d = a.config;
798
- if (d._retry) {
801
+ const c = a.config;
802
+ if (c._retry) {
799
803
  const b = v();
800
804
  return f("response:retry-already-used", {
801
805
  code: r,
802
806
  url: a.config.url
803
- }), await T({ code: r, message: b, response: a }), Promise.reject(new Error(b));
807
+ }), await x({ code: r, message: b, response: a }), Promise.reject(new Error(b));
804
808
  }
805
- d._retry = !0;
809
+ c._retry = !0;
806
810
  try {
807
811
  return f("refresh-token:start", {
808
812
  code: r,
809
813
  url: a.config.url
810
- }), await $(), f("refresh-token:success:retry-request", {
814
+ }), await V(), f("refresh-token:success:retry-request", {
811
815
  code: r,
812
816
  url: a.config.url
813
- }), o.request(d);
817
+ }), o.request(c);
814
818
  } catch (b) {
815
819
  const M = v();
816
820
  return f("refresh-token:error:trigger-modal", {
817
821
  code: r,
818
822
  url: a.config.url,
819
823
  error: b
820
- }), await T({
824
+ }), await x({
821
825
  code: r,
822
826
  message: M,
823
827
  response: a,
@@ -826,39 +830,39 @@ ${r.message}`
826
830
  }
827
831
  }
828
832
  if (Number(r) === 403) {
829
- const d = g(
833
+ const c = g(
830
834
  r,
831
835
  t("api.noPermissionOperation", "暂无操作权限")
832
836
  );
833
- return k(d), D({ code: r, message: d, response: a }), Promise.reject(new Error(d));
837
+ return k(c), S({ code: r, message: c, response: a }), Promise.reject(new Error(c));
834
838
  }
835
839
  if (Number(r) === 510) {
836
- const d = {
837
- machineCode: L(y, "machineCode"),
838
- expireTime: L(y, "expireTime"),
840
+ const c = {
841
+ machineCode: B(y, "machineCode"),
842
+ expireTime: B(y, "expireTime"),
839
843
  rawData: y
840
844
  };
841
- c0(d, a, e);
845
+ u0(c, a, e);
842
846
  return;
843
847
  }
844
848
  if (Number(r) === 1002031003)
845
- return D({ code: r, message: l, response: a }), Promise.reject(new Error(l));
846
- if (!H(r, e.successCodes)) {
847
- const d = g(
849
+ return S({ code: r, message: l, response: a }), Promise.reject(new Error(l));
850
+ if (!G(r, e.successCodes)) {
851
+ const c = g(
848
852
  r,
849
853
  N(r, l, e.locale, e.lang)
850
854
  );
851
- return k(d), D({ code: r, message: d, response: a }), Promise.reject(new Error(d));
855
+ return k(c), S({ code: r, message: c, response: a }), Promise.reject(new Error(c));
852
856
  }
853
857
  return e.transformResponse ? e.transformResponse(a.data) : e.unwrapData ? a.data.data : a.data;
854
858
  });
855
- return o.interceptors.response.use(G, (a) => {
859
+ return o.interceptors.response.use(W, (a) => {
856
860
  var s, h, y, p;
857
861
  const { response: r } = a;
858
862
  if (r && ((s = r.config) == null ? void 0 : s.responseType) === "blob" && typeof Blob < "u" && r.data instanceof Blob)
859
863
  r.data.text().then((l) => {
860
864
  try {
861
- const m = JSON.parse(l), d = N(
865
+ const m = JSON.parse(l), c = N(
862
866
  m.code,
863
867
  m.msg || m.message,
864
868
  e.locale,
@@ -872,13 +876,13 @@ ${r.message}`
872
876
  ) : k(
873
877
  g(
874
878
  m.code,
875
- d || t("api.exportFailed", "导出失败")
879
+ c || t("api.exportFailed", "导出失败")
876
880
  )
877
881
  ), E({
878
882
  code: m.code,
879
883
  message: g(
880
884
  m.code,
881
- d || t("api.exportFailed", "导出失败")
885
+ c || t("api.exportFailed", "导出失败")
882
886
  ),
883
887
  response: r,
884
888
  error: a
@@ -907,12 +911,12 @@ ${r.message}`
907
911
  return (p = e.onResponseError) == null || p.call(e, a), Promise.reject(a);
908
912
  }), {
909
913
  service: o,
910
- refreshToken: R,
914
+ refreshToken: D,
911
915
  request: {
912
916
  request: (a) => o.request(a),
913
917
  get: (a, r = {}) => typeof a == "string" ? o.get(
914
918
  a,
915
- j(r)
919
+ H(r)
916
920
  ) : o.request({
917
921
  ...a,
918
922
  method: "get"
@@ -928,14 +932,14 @@ ${r.message}`
928
932
  ),
929
933
  delete: (a, r = {}) => typeof a == "string" ? o.delete(
930
934
  a,
931
- j(r)
935
+ H(r)
932
936
  ) : o.request({
933
937
  ...a,
934
938
  method: "delete"
935
939
  })
936
940
  }
937
941
  };
938
- }, o0 = (e) => {
942
+ }, d0 = (e) => {
939
943
  const t = e.data.data, n = e.data;
940
944
  return {
941
945
  code: e.data.code,
@@ -943,59 +947,59 @@ ${r.message}`
943
947
  refreshToken: (t == null ? void 0 : t.refreshToken) ?? n.refreshToken,
944
948
  loginInfo: t
945
949
  };
946
- }, d0 = async (e, t, n) => {
947
- var u, c, x, w, g, D, E, k, f, v;
950
+ }, l0 = async (e, t, n) => {
951
+ var u, d, T, w, g, S, E, k, f, v;
948
952
  const i = ((u = e.headers) == null ? void 0 : u["content-type"]) || "";
949
953
  if (!String(i).includes("application/json"))
950
954
  return e.data;
951
955
  const o = await e.data.text();
952
956
  try {
953
- const T = JSON.parse(o);
954
- if (Number(T.code) === 403) {
955
- const R = C(
956
- T.code,
957
+ const x = JSON.parse(o);
958
+ if (Number(x.code) === 403) {
959
+ const D = C(
960
+ x.code,
957
961
  n("api.noPermissionOperation", "暂无操作权限"),
958
- B(t)
962
+ Q(t)
959
963
  );
960
- return (x = (c = t.ui) == null ? void 0 : c.error) == null || x.call(c, R), (w = t.onBusinessError) == null || w.call(t, { code: T.code, message: R, response: e }), Promise.reject(new Error(R));
964
+ return (T = (d = t.ui) == null ? void 0 : d.error) == null || T.call(d, D), (w = t.onBusinessError) == null || w.call(t, { code: x.code, message: D, response: e }), Promise.reject(new Error(D));
961
965
  }
962
- if (H(T.code, t.successCodes)) return e.data;
963
- const S = C(
964
- T.code,
966
+ if (G(x.code, t.successCodes)) return e.data;
967
+ const R = C(
968
+ x.code,
965
969
  N(
966
- T.code,
967
- T.msg || T.message,
970
+ x.code,
971
+ x.msg || x.message,
968
972
  t.locale,
969
973
  t.lang
970
974
  ),
971
- B(t)
975
+ Q(t)
972
976
  );
973
- return (D = (g = t.ui) == null ? void 0 : g.error) == null || D.call(g, S), (E = t.onBusinessError) == null || E.call(t, { code: T.code, message: S, response: e }), Promise.reject(new Error(S));
977
+ return (S = (g = t.ui) == null ? void 0 : g.error) == null || S.call(g, R), (E = t.onBusinessError) == null || E.call(t, { code: x.code, message: R, response: e }), Promise.reject(new Error(R));
974
978
  } catch {
975
- const T = n("api.exportFailed", "导出失败");
976
- return (f = (k = t.ui) == null ? void 0 : k.error) == null || f.call(k, T), (v = t.onHttpError) == null || v.call(t, { message: T, response: e }), Promise.reject(new Error(T));
979
+ const x = n("api.exportFailed", "导出失败");
980
+ return (f = (k = t.ui) == null ? void 0 : k.error) == null || f.call(k, x), (v = t.onHttpError) == null || v.call(t, { message: x, response: e }), Promise.reject(new Error(x));
977
981
  }
978
- }, c0 = (e, t, n) => {
979
- var i, o, u, c, x;
980
- if ((i = n.onAuthorizationExpired) == null || i.call(n, { payload: e, response: t }), l0(n)) {
981
- u0(e, n);
982
+ }, u0 = (e, t, n) => {
983
+ var i, o, u, d, T;
984
+ if ((i = n.onAuthorizationExpired) == null || i.call(n, { payload: e, response: t }), m0(n)) {
985
+ h0(e, n);
982
986
  return;
983
987
  }
984
- e.expireTime ? (u = (o = n.authorization) == null ? void 0 : o.openExpired) == null || u.call(o, e) : (x = (c = n.authorization) == null ? void 0 : c.open) == null || x.call(c, e);
985
- }, l0 = (e) => {
988
+ e.expireTime ? (u = (o = n.authorization) == null ? void 0 : o.openExpired) == null || u.call(o, e) : (T = (d = n.authorization) == null ? void 0 : d.open) == null || T.call(d, e);
989
+ }, m0 = (e) => {
986
990
  var n;
987
991
  if ((n = e.authorization) != null && n.isInMicroApp)
988
992
  return e.authorization.isInMicroApp();
989
- if (!I()) return !1;
993
+ if (!A()) return !1;
990
994
  const t = window;
991
995
  return !!(t.__MICRO_APP_ENVIRONMENT__ || t.__MICRO_APP_BASE_APPLICATION__);
992
- }, u0 = (e, t) => {
993
- var o, u, c, x;
996
+ }, h0 = (e, t) => {
997
+ var o, u, d, T;
994
998
  if ((o = t.authorization) != null && o.dispatchMicroAppEvent) {
995
999
  t.authorization.dispatchMicroAppEvent(e);
996
1000
  return;
997
1001
  }
998
- if (!I()) return;
1002
+ if (!A()) return;
999
1003
  const n = {
1000
1004
  type: "authorization_expired",
1001
1005
  machineCode: e.machineCode,
@@ -1005,26 +1009,26 @@ ${r.message}`
1005
1009
  const g = window[i];
1006
1010
  if (typeof (g == null ? void 0 : g.dispatch) == "function") {
1007
1011
  g.dispatch({
1008
- myname: ((c = t.authorization) == null ? void 0 : c.microAppName) ?? i,
1012
+ myname: ((d = t.authorization) == null ? void 0 : d.microAppName) ?? i,
1009
1013
  data: n
1010
1014
  });
1011
1015
  return;
1012
1016
  }
1013
1017
  }
1014
1018
  window.dispatchEvent(
1015
- new CustomEvent(((x = t.authorization) == null ? void 0 : x.eventName) ?? i0, {
1019
+ new CustomEvent(((T = t.authorization) == null ? void 0 : T.eventName) ?? o0, {
1016
1020
  detail: n
1017
1021
  })
1018
1022
  );
1019
- }, L = (e, t) => {
1023
+ }, B = (e, t) => {
1020
1024
  if (!e || typeof e != "object") return;
1021
1025
  const n = e;
1022
1026
  return typeof n[t] == "string" ? n[t] : void 0;
1023
1027
  }, C = (e, t, n) => {
1024
1028
  if (e == null || e === "") return t;
1025
- const i = U(n) ? _ : z, o = U(n) ? z : _, u = String(e);
1029
+ const i = j(n) ? _ : U, o = j(n) ? U : _, u = String(e);
1026
1030
  return (i[u] ?? o[u]) || t || i.other || o.other;
1027
- }, U = (e) => typeof e == "string" && e.toLowerCase().startsWith("en"), B = (e) => {
1031
+ }, j = (e) => typeof e == "string" && e.toLowerCase().startsWith("en"), Q = (e) => {
1028
1032
  var t, n, i;
1029
1033
  return ((t = e.getLocale) == null ? void 0 : t.call(e)) ?? ((i = (n = e.locale) == null ? void 0 : n.getLocale) == null ? void 0 : i.call(n)) ?? e.lang;
1030
1034
  }, F = (e, t, n) => {
@@ -1034,14 +1038,14 @@ ${r.message}`
1034
1038
  return;
1035
1039
  }
1036
1040
  e.headers[t] = String(n);
1037
- }, m0 = (e, t) => {
1041
+ }, f0 = (e, t) => {
1038
1042
  Object.entries(t ?? {}).forEach(([n, i]) => {
1039
1043
  i != null && F(e, n, i);
1040
1044
  });
1041
- }, h0 = (e) => Object.entries(e ?? {}).reduce(
1045
+ }, p0 = (e) => Object.entries(e ?? {}).reduce(
1042
1046
  (t, [n, i]) => (i == null || (t[n] = String(i)), t),
1043
1047
  {}
1044
- ), f0 = (e, t) => {
1048
+ ), g0 = (e, t) => {
1045
1049
  var n;
1046
1050
  return t.shouldRefreshToken ? t.shouldRefreshToken(e) : Number((n = e.data) == null ? void 0 : n.code) === 401;
1047
1051
  }, q = (e, t, n, i = {}) => ({
@@ -1049,9 +1053,21 @@ ${r.message}`
1049
1053
  ...e,
1050
1054
  method: t,
1051
1055
  data: e.data ?? n ?? i.data
1052
- }), j = (e) => e ? g0(e) ? e : {
1053
- params: e
1054
- } : {}, p0 = /* @__PURE__ */ new Set([
1056
+ }), H = (e) => e ? x0(e) ? {
1057
+ ...e,
1058
+ params: z(e.params)
1059
+ } : {
1060
+ params: z(e)
1061
+ } : {}, z = (e) => {
1062
+ if (!e) return e;
1063
+ if (typeof URLSearchParams < "u" && e instanceof URLSearchParams) {
1064
+ const o = new URLSearchParams(e);
1065
+ return o.delete("lang"), o;
1066
+ }
1067
+ if (typeof e != "object" || Array.isArray(e)) return e;
1068
+ const t = e, { lang: n, ...i } = t;
1069
+ return i;
1070
+ }, y0 = /* @__PURE__ */ new Set([
1055
1071
  "adapter",
1056
1072
  "auth",
1057
1073
  "baseURL",
@@ -1083,18 +1099,18 @@ ${r.message}`
1083
1099
  "withCredentials",
1084
1100
  "xsrfCookieName",
1085
1101
  "xsrfHeaderName"
1086
- ]), g0 = (e) => !e || typeof e != "object" || typeof URLSearchParams < "u" && e instanceof URLSearchParams ? !1 : Object.keys(e).some((t) => p0.has(t));
1087
- let A = null;
1088
- const T0 = (e) => {
1089
- const t = s0(e);
1090
- return A = t, t;
1091
- }, x0 = (e) => (A = e, e), P = () => {
1092
- if (!A)
1102
+ ]), x0 = (e) => !e || typeof e != "object" || typeof URLSearchParams < "u" && e instanceof URLSearchParams ? !1 : Object.keys(e).some((t) => y0.has(t));
1103
+ let I = null;
1104
+ const k0 = (e) => {
1105
+ const t = c0(e);
1106
+ return I = t, t;
1107
+ }, b0 = (e) => (I = e, e), P = () => {
1108
+ if (!I)
1093
1109
  throw new Error(
1094
1110
  "Request SDK is not initialized. Call setupRequestSdk(...) or install the Vue plugin first."
1095
1111
  );
1096
- return A;
1097
- }, k0 = {
1112
+ return I;
1113
+ }, E0 = {
1098
1114
  request: (e) => P().request.request(e),
1099
1115
  get: (e, t) => P().request.get(
1100
1116
  e,
@@ -1107,7 +1123,7 @@ const T0 = (e) => {
1107
1123
  e,
1108
1124
  t
1109
1125
  )
1110
- }, b0 = new Proxy(
1126
+ }, w0 = new Proxy(
1111
1127
  {},
1112
1128
  {
1113
1129
  get(e, t) {
@@ -1116,15 +1132,15 @@ const T0 = (e) => {
1116
1132
  }
1117
1133
  );
1118
1134
  export {
1119
- i0 as A,
1135
+ o0 as A,
1120
1136
  P as a,
1121
- n0 as b,
1122
- s0 as c,
1123
- T0 as d,
1124
- e0 as e,
1137
+ s0 as b,
1138
+ c0 as c,
1139
+ k0 as d,
1140
+ r0 as e,
1125
1141
  N as g,
1126
- b0 as h,
1127
- H as i,
1128
- k0 as r,
1129
- x0 as s
1142
+ w0 as h,
1143
+ G as i,
1144
+ E0 as r,
1145
+ b0 as s
1130
1146
  };
@@ -0,0 +1,3 @@
1
+ "use strict";const L=require("axios"),Z="System error",e0={400:"Invalid request parameters",401:"Unauthorized. Token, username, or password is incorrect.",403:"Access is forbidden.",404:"Network request error. Resource not found.",405:"Network request error. Method not allowed.",408:"Network request timed out.",500:"System error",501:"Network request is not implemented.",502:"Network error.",503:"Service unavailable. The server is overloaded or under maintenance.",504:"Network timeout.",505:"HTTP version is not supported.",507:"The maximum export quantity is 100000.",7e5:"Invalid code [{}]",700001:"The export quantity exceeds the limit. The maximum allowed is [{}].",700002:"The data exceeds [{}] records. Please narrow the query range.",700003:"Device [{}] is offline.",700004:"Device [{}] has no GPS information.",700005:"File already exists. Path: [{}]",700006:"Invalid file name.",700007:"File size exceeds the limit.",700008:"Unsupported file type.",700009:"File is empty.",700010:"Only [{}] files are supported.",700011:"File parsing failed.",700012:"File saving failed.",700013:"No online devices.",700014:"Invalid file path.",700015:"File upload failed.",700016:"File export failed.",700017:"User does not exist.",700018:"File does not exist.",700019:"Parameter is empty.",700020:"Local language is empty.",700021:"Device history data does not exist.",700022:"Device [{}] longitude is empty.",700023:"Device [{}] latitude is empty.",700025:"MD5 algorithm is unavailable.",700026:"Export exception.",700027:"ID is empty.",701e3:"DPD-TDOA raw data is empty.",701001:"DPD-TDOA raw data details are empty.",701002:"TDOA collection frequency is incorrect.",701003:"Algorithm type is empty.",701004:"Flight task ID is empty.",701005:"Target coordinates are empty.",701006:"The number of devices for single collection cannot be less than [{}].",701007:"The number of devices for continuous collection cannot be less than [{}].",701008:"Device reported abnormal gpsTime.",701009:"Failed to correct collection task and record.",701010:"Device code is empty.",701011:"Device [{}] has unfinished collection tasks. Duplicate dispatch is not allowed.",701012:"No warning level matched for area type [{}].",701013:"Failed to store IQ data file.",701014:"Failed to store IQ data file.",701015:"Firmware metadata not found.",701016:"Firmware data is empty.",701017:"Firmware for this device model and version already exists.",701018:"Failed to upload and parse firmware.",701019:"Collection data is empty.",701020:"Collection task ID is empty.",701021:"Failed to save drone reported image.",701022:"Failed to convert drone reported image.",701023:"Device height above ground is invalid.",701024:"Device detection range is invalid.",701025:"Failed to convert drone reported video.",701026:"Failed to save trajectory data.",701027:"Whitelist data has expired and cannot be modified.",701028:"Whitelist data has overlapping time and cannot be added.",701029:"Seconds cannot be negative.",701030:"Start time is empty.",701031:"End time is empty.",701032:"Start time is later than end time.",701033:"End time is earlier than current time.",701034:"Start time and end time are the same.",701035:"Failed to build drone warning data.",701036:"Failed to save drone data.",701040:"Area name already exists.",701041:"Area name is empty.",701052:"There are locked drones. Please unlock them before operating.",701056:"Only hourly or daily grouping is supported.",701057:"Firmware package is damaged or unreadable. Please check the firmware file.",704001:"Event identifier cannot be empty.",704002:"Event type cannot be empty.",704003:"Defense area number cannot be empty.",704004:"Data forwarding endpoint cannot be empty.",704020:"Reporting method cannot be empty.",704021:"Platform code cannot be empty.",704022:"Platform name cannot be empty.",704023:"The defense area does not exist.",704024:"Platform code already exists. Please use another one.",704028:"Currently only MQTT forwarding protocol is supported.",704033:"Connection test failed: [{}]",704034:"Test sending failed: [{}]",704037:"Data forwarding task does not exist.",704040:"Data forwarding endpoint does not exist.",705e3:"Configuration ID cannot be empty.",705001:"System configuration information cannot be empty.",705002:"Configuration value cannot be empty.",705003:"Configuration key cannot be empty.",705004:"Configuration key length cannot exceed [{}] characters.",705005:"Configuration key already exists.",705006:"Configuration does not exist.",1001000001:"Parameter configuration does not exist.",1001000002:"Parameter configuration key is duplicated.",1001000003:"Built-in system parameter configurations cannot be deleted.",1001000004:"Failed to get parameter configuration because hidden configurations are not allowed.",1001003001:"File does not exist.",1001003002:"File is empty.",1001003003:"Unsupported image format.",1001003004:"Image file is too large.",1001003005:"Unable to read image file.",1001006e3:"File configuration does not exist.",1001006001:"This file configuration cannot be deleted because it is the primary configuration.",1002e6:"Incorrect account or password.",1002000001:"Login failed. The account has been disabled.",1002000004:"Incorrect verification code.",1002000005:"Account is not bound. Binding is required.",1002000007:"Phone number does not exist.",1002000008:"Incorrect verification code.",1002001e3:"A menu with this name already exists.",1002001001:"Parent menu does not exist.",1002001002:"Cannot set itself as parent menu.",1002001003:"Menu does not exist.",1002001004:"Child menus exist and cannot be deleted.",1002001005:"Parent menu type must be directory or menu.",1002001006:"A menu with this component name already exists.",1002001007:"Invalid menu subtype.",1002001008:"Menu synchronization failed.",1002001009:"Menu node level exceeds the limit.",1002001010:"Invalid menu UUID.",1002001011:"Parent menu does not meet the specification.",1002002e3:"Role does not exist.",1002002001:"Role name is duplicated.",1002002002:"Role code already exists.",1002002003:"Built-in system roles cannot be operated.",1002002004:"Role has been disabled.",1002002005:"Role identifier cannot be used.",1002002006:"This role cannot be deleted.",1002003e3:"This account is already used. Please change it.",1002003001:"The phone number already exists.",1002003002:"The email address already exists.",1002003003:"User does not exist.",1002003004:"Imported user data cannot be empty.",1002003005:"Old password is incorrect.",1002003006:"This user has been disabled.",1002003008:"Failed to create user. Tenant quota exceeded.",1002003010:"This phone number has not been registered.",1002003011:"Registration is disabled.",1002003012:"This user is enabled and cannot be deleted.",1002003013:"Invalid region code.",1002003014:"Login account is display-only and cannot be edited.",1002003015:"Parsing failed.",1002003016:"Parsing failed: each import cannot exceed 10000 records. Please split the file.",1002003017:"Parsing failed: imported data cannot be empty.",1002003018:"Upload failed: file size exceeds the 10MB limit.",1002003019:"File parsing failed: only .xlsx template files are supported.",1002005e3:"The current position does not exist.",1002005001:"The position is not enabled and cannot be selected.",1002005002:"A position with this name already exists.",1002005003:"A position with this identifier already exists.",1002006001:"The current dictionary type does not exist.",1002006002:"The dictionary type is not enabled and cannot be selected.",1002006003:"Dictionary name already exists.",1002006004:"Dictionary code already exists.",1002006005:"Cannot delete. Dictionary values still exist under this dictionary.",1002006006:"Invalid dictionary synchronization request.",1002007001:"The current dictionary data does not exist.",1002007002:"The dictionary data is not enabled and cannot be selected.",1002007003:"Dictionary key already exists.",1002007004:"Dictionary label already exists.",1002031001:"Authorization has expired.",10021e5:"File service exception. Please check and test the file configuration.",1086001001:"System error.",1086001002:"Request error.",1086001003:"Enum not found.",1086001004:"Invalid parameter.",1086001005:"File is empty.",1086001006:"Invalid format.",1086002001:"Manufacturer code does not exist.",1086002002:"Device is not registered. Please register it first.",1086002003:"Invalid device creation parameters.",1086002004:"Dock or drone device already exists. Please check the SN.",1086002005:"Device does not exist.",1086002006:"Device is offline.",1086003004:"No flight or payload control permission.",1086003005:"Dock is offline.",1086003006:"Drone is offline.",1086003028:"Device is offline. DRC control cannot be performed.",1086003032:"Live stream failed because the device is offline.",1086003033:"Unable to pull the device stream. Please try again.",1086003034:"Live stream type is not supported.",1086004001:'File name cannot contain illegal characters <>:"/',1086004002:"Route does not exist.",1086004003:"This route is used by pending tasks. Please delete the tasks first.",1086004004:"Route creation failed.",1086004005:"Route file name already exists.",1086004006:"The number of waypoints is less than 2.",1086004007:"The number of waypoints is greater than 50.",1086004008:"Route update failed.",1086005001:"Speaker or TTS file does not exist.",1086005002:"Speaker file upload failed.",1086005003:"Speaker file saving failed.",1086005004:"Invalid speaker file format. Only MP3 is supported.",1086005005:"Speaker file size exceeds the limit. A single file cannot exceed 5MB.",1086005006:"Speaker file name is duplicated on this device.",1086008001:"Route name cannot be empty.",1086008002:"Plan name already exists.",1086008003:"Execution time cannot be earlier than current time.",1086008004:"Plan does not exist.",1086008008:"Route task does not exist.",1086008014:"Task report is being generated. Please try again later.",1086009001:"Space name is duplicated.",1086009002:"Invalid parent space.",1086009003:"Detected circular parent space.",1086009004:"Space or child nodes are bound to devices and cannot be deleted.",1086009005:"Space level has reached the maximum limit.",1086009006:"Root node cannot be deleted.",1086009007:"Root node already exists and cannot be created again.",1086009008:"Failed to query monitoring device list.",1500000001:"Failed to initialize platform MQTT client instance.",1500000002:"Failed to connect to MQTT broker.",1500000003:"MQTT connection lost unexpectedly.",1500000004:"instanceName cannot be empty.",1500000005:"Forwarding configuration already exists.",1500000006:"Forwarding configuration does not exist.",1500000008:"Target instance is unavailable: {}",1500000009:"Request instance {} does not match current node {}.",1500000010:"Please disable forwarding configuration before deleting it.",1500000011:"Failed to release MQTT physical connection.",1500000012:"Changing forwarding configuration ownership through update is not allowed.",1500000013:"payloadTransformScript length cannot exceed {} characters.",1500000014:"payloadTransformScript compilation failed: {}",1500000015:"Invalid brokerUrl format. Use mqtt://host:port, mqtts://host:port, tcp://host:port, or ssl://host:port.",other:Z},t0="系统异常",r0={400:"参数错误",401:"用户没有权限(令牌、用户名、密码错误)!",403:"用户得到授权,但是访问是被禁止的。!",404:"网络请求错误,未找到该资源!",405:"网络请求错误,请求方法未允许!",408:"网络请求超时!",500:"系统错误",501:"网络未实现!",502:"网络错误!",503:"服务不可用,服务器暂时过载或维护!",504:"网络超时!",505:"http版本不支持该请求!",507:"超过最大导出数量为100000",7e5:"非法的CODE[{}]",700001:"导出数量超过限制,最大允许导出[{}]条",700002:"数据超过[{}]条,请缩小查询范围",700003:"设备[{}]不在线",700004:"设备[{}]未获取到GPS信息",700005:"文件已存在, 路径[{}]",700006:"文件名非法",700007:"文件大小超出限制",700008:"不支持的文件类型",700009:"文件为空",700010:"仅支持[{}]格式的文件",700011:"文件解析失败",700012:"文件保存失败",700013:"当前无在线设备",700014:"文件路径非法",700015:"文件上传失败",700016:"文件导出失败",700017:"用户不存在",700018:"文件不存在",700019:"参数为空",700020:"当地语言为空",700021:"设备历史数据不存在",700022:"设备[{}]经度为空",700023:"设备[{}]纬度为空",700025:"MD5算法不可用",700026:"导出异常",700027:"ID为空",701e3:"dpd-tdoa原始数据为空",701001:"dpd-tdoa原始数据详情为空",701002:"TDOA采集频率不正确",701003:"算法类型为空",701004:"飞行任务ID为空",701005:"靶标坐标为空",701006:"单次采集设备数量不能小于[{}]台",701007:"连续采集设备数量不能小于[{}]台",701008:"设备上报gpsTime异常",701009:"订正采集任务和采集记录异常",701010:"设备编码为空",701011:"设备[{}]有未完成采集任务,禁止重复下发",701012:"区域类型未匹配到预警等级[{}]",701013:"IQ数据文件存储失败",701014:"IQ数据文件存储失败",701015:"未找到固件元信息",701016:"固件数据为空",701017:"该设备型号和固件版本的固件已存在",701018:"上传解析固件失败",701019:"采集数据为空",701020:"采集任务ID为空",701021:"无人机上报图片保存失败",701022:"无人机上报图片转换失败",701023:"设备相对地面高度非法",701024:"设备侦测范围非法",701025:"无人机上报视频转换失败",701026:"轨迹数据保存失败",701027:"白名单数据已失效, 禁止修改",701028:"白名单数据已存在时间交叉, 禁止新增",701029:"秒数不能为负数",701030:"有效时间起为空",701031:"有效时间止为空",701032:"有效时间起大于有效时间止",701033:"有效时间止小于当前时间",701034:"有效时间起止相同",701035:"构建无人机预警数据异常",701036:"保存无人机数据失败",701037:"固件文件访问URL不存在",701038:"没有找到对应设备型号的设备,无法下发固件升级命令",701039:"设备固件发布状态为空",701040:"区域名称已存在",701041:"区域名称为空",701042:"无人机停飞事件处理推送失败",701043:"无人机通用识别类型为空",701044:"无人机识别类型为空",701045:"DISCERN_PARSE识别类型暂不支持锁定和解锁",701046:"TDOA结果上报事件处理失败, 设备编码[{}]",701047:"仿真日志推送事件处理失败",701048:"单次数据采集少于[{}]个IQ文件",701049:"侦测设备位置信息列表为空",701050:"无人机数据为空",701051:"算法结果是否合并参数为空",701052:"有无人机锁定,请先解锁后操作",701053:"锁定信息序列化失败",701054:"解析锁定信息失败",701055:"更新锁定成功动作失败",701056:"仅支持按小时或按天分组",701057:"固件包文件损坏或无法读取, 请检查固件文件是否符合规范",701058:"固件包中存在多个JSON文件, 请检查固件文件是否符合规范",701059:"固件包中存在多个BIN文件, 请检查固件文件是否符合规范",701060:"固件包中缺少JSON文件, 请检查固件文件是否符合规范",701061:"固件包中缺少BIN文件, 请检查固件文件是否符合规范",704e3:"标准化转发事件不能为空",704001:"事件标识不能为空",704002:"事件类型不能为空",704003:"防区编号不能为空",704004:"数据转发端点不能为空",704005:"待发送消息ID不能为空",704006:"待发送消息不存在",704007:"发送成功的消息不允许重发",704008:"待发送消息ID列表不能为空",704009:"待发送消息关联的端点不存在",704010:"待发送消息关联的主任务不存在",704011:"数据转发任务已禁用,请先启用后再重发",704012:"数据转发任务新增请求不能为空",704013:"数据转发任务更新请求不能为空",704014:"更新时任务ID不能为空",704015:"状态更新请求不能为空",704016:"数据转发任务ID不能为空",704017:"端点ID不能为空",704018:"端点状态请求不能为空",704019:"端点配置不能为空",704020:"上报方式不能为空",704021:"平台编码不能为空",704022:"平台名称不能为空",704023:"所属防区不存在",704024:"平台编码已存在,请更换后重试",704025:"启用数据转发任务前至少需要配置一个端点",704026:"同一任务下服务地址与Topic不允许重复",704027:"启用数据转发任务时至少需要一个启用中的端点",704028:"当前仅支持MQTT转发协议",704029:"消息可靠性仅允许0、1、2",704030:"持久会话配置非法",704031:"至少需要选择一种推送数据类型",704032:"存在不支持的推送数据类型",704033:"测试连接失败: [{}]",704034:"测试发送失败: [{}]",704035:"初始化数据转发MQTT客户端失败: [{}]",704036:"刷新数据转发MQTT客户端失败: [{}]",704037:"数据转发任务不存在",704038:"数据转发任务不能为空",704039:"数据转发任务已被其他用户修改,请刷新后重试",704040:"数据转发端点不存在",704041:"当前主任务已启用,至少需要保留一个启用中的端点",704042:"接口地址不能为空",704043:"Topic不能为空",704044:"MQTT客户端标识不能为空",704045:"接口地址格式非法,请使用tcp://ip:port",704046:"接口地址中的IP非法",704047:"接口地址中的端口非法,范围为1-65535",705e3:"配置ID不能为空",705001:"系统配置信息不能为空",705002:"配置值不能为空",705003:"配置键不能为空",705004:"配置键长度不能超过[{}]个字符",705005:"配置键已存在",705006:"配置不存在",1001000001:"参数配置不存在",1001000002:"参数配置 key 重复",1001000003:"不能删除类型为系统内置的参数配置",1001000004:"获取参数配置失败,原因:不允许获取不可见配置",1001003001:"文件不存在",1001003002:"文件为空",1001003003:"不支持的图片格式",1001003004:"图片文件过大",1001003005:"无法读取图片文件",1001006e3:"文件配置不存在",1001006001:"该文件配置不允许删除,原因:它是主配置,删除会导致无法上传文件",1002e6:"账号或密码错误!",1002000001:"登录失败,账号已停用!",1002000004:"验证码不正确",1002000005:"未绑定账号,需要进行绑定",1002000007:"手机号不存在",1002000008:"验证码不正确",1002001e3:"已经存在该名字的菜单",1002001001:"父菜单不存在",1002001002:"不能设置自己为父菜单",1002001003:"菜单不存在",1002001004:"存在子菜单,无法删除",1002001005:"父菜单的类型必须是目录或者菜单",1002001006:"已经存在该组件名的菜单",1002001007:"菜单子类型非法",1002001008:"菜单同步失败",1002001009:"菜单子节点层级超过限制",1002001010:"菜单 UUID 非法",1002001011:"父菜单不符合规范",1002002e3:"角色不存在",1002002001:"角色名称重复",1002002002:"角色编码已存在",1002002003:"不能操作类型为系统内置的角色",1002002004:"角色已被禁用",1002002005:"角色标识不能使用",1002002006:"不允许删除该角色",1002003e3:"该账号已被占用,请更换!",1002003001:"输入手机号已存在!",1002003002:"输入电子邮箱已存在!",1002003003:"用户不存在",1002003004:"导入用户数据不能为空!",1002003005:"旧密码输入错误!",1002003006:"该用户已被禁用",1002003008:"创建用户失败,超过租户最大租户配额",1002003010:"该手机号尚未注册",1002003011:"注册功能已关闭",1002003012:"该用户处于开启状态,不能删除",1002003013:"地区编码错误",1002003014:"登录账号仅展示,不允许编辑",1002003015:"解析失败",1002003016:"解析失败:单次导入数据不得超过10000条,请拆分文件!",1002003017:"解析失败:导入数据不能为空!",1002003018:"上传失败:文件大小超过 10MB 上限!",1002003019:"文件解析失败:仅支持上传 .xlsx 模板文件,请检查后重试!",1002005e3:"当前岗位不存在",1002005001:"岗位不处于开启状态,不允许选择",1002005002:"已经存在该名字的岗位",1002005003:"已经存在该标识的岗位",1002006001:"当前字典类型不存在",1002006002:"字典类型不处于开启状态,不允许选择",1002006003:"字典名称已存在",1002006004:"字典编码已存在",1002006005:"无法删除!当前字典下仍存在字典值!",1002006006:"字典同步请求不合法",1002007001:"当前字典数据不存在",1002007002:"字典数据不处于开启状态,不允许选择",1002007003:"字典键值已存在",1002007004:"字典标签已存在",1002031001:"授权已过期",10021e5:"文件服务异常,请检查并测试文件配置是否正确",1086001001:"系统错误",1086001002:"请求错误",1086001003:"枚举未找到",1086001004:"参数无效",1086001005:"文件为空",1086001006:"格式错误",1086002001:"制造商代码不存在",1086002002:"设备未注册,请先注册后再试!",1086002003:"设备创建参数无效",1086002004:"机库/无人机设备已存在,请检查SN码",1086002005:"设备不存在",1086002006:"设备离线",1086002007:"创建设备型号失败",1086002008:"查询所有列表失败",1086002009:"从父代码查询列表失败",1086002010:"远程调试操作失败",1086002011:"设备未注册远程调试",1086002012:"设备离线,无法进行远程调试",1086002013:"远程调试通信超时",1086002014:"远程调试MQTT错误",1086003001:"飞机调试未知错误",1086003002:"飞机已在返航中",1086003003:"飞机已在调试模式",1086003004:"无飞行/挂载控制权限",1086003005:"机库离线",1086003006:"无人机离线",1086003007:"机库控制指令报错",1086003008:"直点飞行启动报错",1086003009:"直点飞行停止报错",1086003010:"正在执行指令飞行操作,无法执行指点飞行,请稍后重试",1086003011:"正在执行指令飞行操作,无法执行航线下发,请稍后重试",1086003012:"正在执行自动降落/返航操作,无法执行指点飞行",1086003013:"正在执行自动降落/返航操作,无法执行航线下发",1086003014:"下发空中航线报错,具体错误原因:",1086003015:"下发空中航线报错,没有对应一键起飞参数",1086003016:"飞行基础配置不存在",1086003017:"无人机无法起飞,原因是",1086003018:"获取飞行控制权失败",1086003019:"获取负载控制权失败",1086003020:"负载控制命令执行报错",1086003021:"飞行基础配置未找到",1086003022:"保存飞行基础配置失败",1086003023:"进入DRC模式失败",1086003024:"DRC摇杆控制失败",1086003025:"DRC急停失败",1086003026:"DRC紧急迫降失败",1086003027:"设备离线,无法执行DRC控制",1086003028:"DRC探照灯模式设置失败",1086003029:"DRC探照灯亮度设置失败",1086003030:"DRC探照灯角度微调失败",1086003031:"DRC探照灯校准失败",1086003032:"直播流失败原因:设备离线",1086003033:"设备拉不到流,请重试",1086003034:"直播流类型不支持",1086004001:'文件名不能包含非法字符 <>:"/',1086004002:"航线不存在",1086004003:"存在有待执行任务使用该航线,请删除任务后重试!",1086004004:"航线创建失败",1086004005:"航线文件名称已存在",1086004006:"航点数小于2",1086004007:"航点数大于50",1086004008:"航线更新失败",1086004009:"全局返航高度必须为正整数",1086004010:"全局返航高度必须在20-1500之间",1086005001:"扬声器/tts文件不存在",1086005002:"扬声器文件上传失败",1086005003:"扬声器文件保存失败",1086005004:"扬声器文件格式无效,仅支持 MP3 格式",1086005005:"扬声器文件大小超出限制,单个文件大小不得超过 5MB",1086005006:"扬声器文件名重复,该设备已存在同名文件",1086005007:"扬声器文件参数无效",1086005008:"当文件类型为 0 时,必须提供录音文件",1086005009:"当文件类型为 1 时,必须提供扬声器内容",1086005010:"喊话文件超过最大限制数",1086005011:"当前文件状态为下载或传输中,不支持切换文件播放",1086005012:"扬声器未同步到设备,请稍后重试",1086005013:"MP3格式转PCM格式失败,请重新上传MP3文件后重试",1086005014:"录音内容为空",1086005015:"媒体文件不存在",1086005016:"媒体文件删除失败",1086005017:"媒体文件下载失败",1086005018:"文件路径不能为空",1086005019:"OSS文件删除失败",1086005020:"文件压缩失败",1086006001:"http服务调用失败",1086006002:"算法服务未配置",1086006003:"请等待算法服务处理完成!",1086007001:"地图标注不存在",1086008001:"航线名称不能为空",1086008002:"计划名称已存在",1086008003:"执行时间不能早于当前时间",1086008004:"计划不存在",1086008005:"方案计划不存在可执行任务",1086008006:"飞机尚未进入航线或已退出航线,无法暂停",1086008007:"不支持的航线任务控制指令",1086008008:"航线任务不存在",1086008009:"恢复航线任务失败",1086008010:"任务状态不为执行中,暂停失败",1086008011:"任务状态不支持终止",1086008012:"取消航线任务失败",1086008013:"飞机返航失败",1086008014:"任务报告生成中,请稍后重试",1086009001:"空间名称重复",1086009002:"空间父级无效",1086009003:"检测到空间父级循环",1086009004:"空间或其子节点已绑定设备,不允许删除",1086009005:"空间层级已达到最大限制,无法继续新增",1086009006:"根节点不允许删除",1086009007:"根节点已存在,不能重复创建根节点",1086009008:"查询监控设备列表错误",1086010001:"飞行区不存在",1500000001:"初始化平台 MQTT 客户端实例异常",1500000002:"与 MQTT 代理服务器连接失败",1500000003:"MQTT 连接意外丢失",1500000004:"instanceName 不能为空",1500000005:"转发配置已存在",1500000006:"转发配置不存在",1500000008:"目标实例不可用:{}",1500000009:"请求实例 {} 与当前节点 {} 不匹配",1500000010:"请先停用转发配置再删除",1500000011:"MQTT 物理连接释放失败",1500000012:"不允许通过更新变更转发配置归属实例",1500000013:"payloadTransformScript 长度不能超过 {} 字符",1500000014:"payloadTransformScript 编译失败:{}",1500000015:"brokerUrl 格式非法,需使用 mqtt://host:port、mqtts://host:port、tcp://host:port 或 ssl://host:port",other:t0},a0=[0,200],n0={"api.accountExpired":"Your account has expired. Please log in again.","api.permissionExpiredTitle":"Permission expired","api.permissionExpiredContent":"Your account has expired. Please log in again.","api.permissionExpiredOkText":"OK","api.networkExceptionMsg":"Network connection error","api.systemException":"System error","api.noPermissionOperation":"No permission to perform this operation","api.exportFailed":"Export failed","api.tokenExpired":"Your account has expired. Please log in again."},V=(e,t,n)=>i0(n)?n0[e]??t??e:t??e,i0=e=>typeof e=="string"&&e.toLowerCase().startsWith("en"),G=e=>{var o,u,c;if(typeof e!="string")return;const t=((o=e.match(/【([^】]+)】/))==null?void 0:o[1])||((u=e.match(/\(([^)]+)\)/))==null?void 0:u[1]),n=(c=e.match(/原因[::]\s*(.+)$/))==null?void 0:c[1],i={};return t&&(i.value=t),n&&(i.reason=n),Object.keys(i).length?i:void 0},s0=(e,t)=>(n,i,o)=>{var c;const u=(c=e==null?void 0:e.translate)==null?void 0:c.call(e,n,i,o);return u&&u!==n?u:V(n,i,t)},q=(e,t,n,i)=>{var x,w;const u=`api.errMsg${String(e??"")}`,c=(x=n==null?void 0:n.translate)==null?void 0:x.call(n,u,void 0,G(t));return c&&c!==u?c:typeof t=="string"&&t||((w=n==null?void 0:n.translate)==null?void 0:w.call(n,"api.systemException","系统异常"))||V("api.systemException","系统异常",i)},o0=(e,t,n="/admin-api")=>typeof e=="function"?e(t):e??`${n}/system/auth/refresh-token?refreshToken=${t??""}`,d0=e=>typeof e=="function"?e():e??"/login",O=(e,t=a0)=>t.some(n=>String(n)===String(e)),W=(e,t="Bearer")=>typeof t=="function"?t(e):t?`${t} ${e}`:e,A=()=>typeof window<"u"&&typeof document<"u",J="http-request-sdk:authorization-expired",U=r0,B=e0,K=(e={})=>{var _;const t=s0(e.locale,e.lang);let n=!1,i=null;const o=L.create({baseURL:e.baseURL??"/admin-api",timeout:e.timeout??3e4,validateStatus:a=>a>=200&&a<300||a===400,paramsSerializer:((_=e.axiosConfig)==null?void 0:_.paramsSerializer)??{indexes:!0},headers:{"Content-Type":"application/json;charset=UTF-8"},...e.axiosConfig}),u=()=>{var h,y,p,l;const a=typeof e.getAccessToken=="function",r=typeof((h=e.token)==null?void 0:h.getAccessToken)=="function",s=((y=e.getAccessToken)==null?void 0:y.call(e))??((l=(p=e.token)==null?void 0:p.getAccessToken)==null?void 0:l.call(p));return console.info("[http-request-sdk][token]","access-token:resolve",{hasGetAccessToken:a,hasTokenGetAccessToken:r,hasToken:!!s,tokenLength:(s==null?void 0:s.length)??0}),s},c=(a,r)=>{console.info("[http-request-sdk][token]",a,{hasToken:!!r,tokenLength:(r==null?void 0:r.length)??0})},x=()=>{var a,r,s;return((a=e.getLocale)==null?void 0:a.call(e))??((s=(r=e.locale)==null?void 0:r.getLocale)==null?void 0:s.call(r))},w=()=>x()??e.lang,g=(a,r)=>C(a,r,w()),P=a=>{var r;(r=e.onBusinessError)==null||r.call(e,a)},E=a=>{var r;(r=e.onHttpError)==null||r.call(e,a)},k=a=>{var r,s;(s=(r=e.ui)==null?void 0:r.error)==null||s.call(r,a)},f=(a,r)=>{console.info("[http-request-sdk][permission-expired]",a,r??{})},v=()=>t("api.accountExpired","您的账号已失效,请重新登录"),T=async a=>{var y,p;const r={...a,message:v()};if(f("triggerTokenExpired:start",{code:r.code,message:r.message,hasShowPermissionExpired:!!((y=e.ui)!=null&&y.showPermissionExpired),modalVisible:n}),n){f("triggerTokenExpired:skip-visible",{code:r.code});return}const s=()=>{n=!1,f("modal:visible-reset",{code:r.code})},h=async()=>{var l,m,d,b;f("modal:onOk:start",{code:r.code,hasOnTokenExpired:!!e.onTokenExpired});try{e.onTokenExpired?await e.onTokenExpired(r):(await((m=(l=e.token)==null?void 0:l.logout)==null?void 0:m.call(l)),(b=(d=e.token)==null?void 0:d.clearToken)==null||b.call(d),A()&&(window.location.href=d0(e.loginUrl))),s(),f("modal:onOk:success",{code:r.code})}catch(M){f("modal:onOk:error",{code:r.code,error:M}),s()}};if(n=!0,f("modal:visible-set",{code:r.code}),(p=e.ui)!=null&&p.showPermissionExpired){f("modal:showPermissionExpired:call",{code:r.code}),e.ui.showPermissionExpired({title:t("api.permissionExpiredTitle","权限失效提醒"),content:r.message,okText:t("api.permissionExpiredOkText","我知道了"),onOk:h,onCancel:s});return}if(A()){f("modal:adapter-missing:native-alert",{code:r.code}),window.alert(`${t("api.permissionExpiredTitle","权限失效提醒")}
2
+
3
+ ${r.message}`),await h();return}f("modal:adapter-missing:run-onOk-without-browser",{code:r.code}),await h()},R=a=>{var r,s,h,y,p;if(a)return a.accessToken&&((s=(r=e.token)==null?void 0:r.setToken)==null||s.call(r,a.accessToken)),a.refreshToken&&((y=(h=e.token)==null?void 0:h.setRefreshToken)==null||y.call(h,a.refreshToken)),(p=e.onRefreshTokenSuccess)==null||p.call(e,a),a.loginInfo},D=async()=>{var h,y,p,l,m,d;if(e.refreshAccessToken){const b=(y=(h=e.token)==null?void 0:h.getRefreshToken)==null?void 0:y.call(h);c("refresh-token:custom-get-refresh-token",b);const M=await e.refreshAccessToken({refreshToken:b,service:o});return R(M)}const a=(l=(p=e.token)==null?void 0:p.getRefreshToken)==null?void 0:l.call(p);c("refresh-token:get-refresh-token",a);const r=await L.post(o0(e.refreshTokenUrl,a,e.baseURL??"/admin-api"),void 0,{headers:p0(e.headers)}),s=((d=(m=e.token)==null?void 0:m.normalizeRefreshResponse)==null?void 0:d.call(m,r))??c0(r);if(s.code===401||s.code===400)throw new Error(v());return R(s)},Y=()=>(i||(i=D().finally(()=>{i=null})),i);o.interceptors.request.use(a=>{const r=u();c("request:get-access-token",r);const s=x();return a.params=z(a.params),r&&F(a,e.authHeaderName??"Authorization",W(r,e.authScheme)),s&&F(a,e.localeHeaderName??"Accept-Language",s),f0(a,e.headers),a},a=>{var r;return(r=e.onRequestError)==null||r.call(e,a),Promise.reject(a)});const X=(async a=>{var m;if(a.config.responseType==="blob")return l0(a,e,t);if(a.status!==200&&a.status!==400){const d=g((m=a.data)==null?void 0:m.code,t("api.networkExceptionMsg","网络连接异常"));return k(d),E({message:d,response:a}),Promise.reject(new Error(d))}const{code:r,msg:s,message:h,data:y}=a.data,l=s||h||t("api.systemException","系统异常");if(Number(r)===400){const d=v();return f("response:code-400:show-modal",{httpStatus:a.status,code:r,message:d,url:a.config.url}),await T({code:r,message:d,response:a}),P({code:r,message:d,response:a}),Promise.reject(new Error(d))}if(g0(a,e)){f("response:should-refresh-token",{httpStatus:a.status,code:r,message:l,url:a.config.url});const d=a.config;if(d._retry){const b=v();return f("response:retry-already-used",{code:r,url:a.config.url}),await T({code:r,message:b,response:a}),Promise.reject(new Error(b))}d._retry=!0;try{return f("refresh-token:start",{code:r,url:a.config.url}),await Y(),f("refresh-token:success:retry-request",{code:r,url:a.config.url}),o.request(d)}catch(b){const M=v();return f("refresh-token:error:trigger-modal",{code:r,url:a.config.url,error:b}),await T({code:r,message:M,response:a,error:b}),Promise.reject(new Error(M))}}if(Number(r)===403){const d=g(r,t("api.noPermissionOperation","暂无操作权限"));return k(d),P({code:r,message:d,response:a}),Promise.reject(new Error(d))}if(Number(r)===510){const d={machineCode:j(y,"machineCode"),expireTime:j(y,"expireTime"),rawData:y};u0(d,a,e);return}if(Number(r)===1002031003)return P({code:r,message:l,response:a}),Promise.reject(new Error(l));if(!O(r,e.successCodes)){const d=g(r,q(r,l,e.locale,e.lang));return k(d),P({code:r,message:d,response:a}),Promise.reject(new Error(d))}return e.transformResponse?e.transformResponse(a.data):e.unwrapData?a.data.data:a.data});return o.interceptors.response.use(X,a=>{var s,h,y,p;const{response:r}=a;if(r&&((s=r.config)==null?void 0:s.responseType)==="blob"&&typeof Blob<"u"&&r.data instanceof Blob)r.data.text().then(l=>{try{const m=JSON.parse(l),d=q(m.code,m.msg||m.message,e.locale,e.lang);Number(m.code)===403?k(g(m.code,t("api.noPermissionOperation","暂无操作权限"))):k(g(m.code,d||t("api.exportFailed","导出失败"))),E({code:m.code,message:g(m.code,d||t("api.exportFailed","导出失败")),response:r,error:a})}catch{const m=t("api.exportFailed","导出失败");k(m),E({message:m,response:r,error:a})}});else if((r==null?void 0:r.status)===403){const l=g((h=r.data)==null?void 0:h.code,t("api.noPermissionOperation","暂无操作权限"));k(l),E({code:403,message:l,response:r,error:a})}else if(r){const l=g((y=r.data)==null?void 0:y.code,t("api.networkExceptionMsg","网络连接异常"));k(l),E({code:r==null?void 0:r.status,message:l,response:r,error:a})}else{const l=t("api.networkExceptionMsg","网络连接异常");k(l),E({message:l,error:a})}return(p=e.onResponseError)==null||p.call(e,a),Promise.reject(a)}),{service:o,refreshToken:D,request:{request:a=>o.request(a),get:(a,r={})=>typeof a=="string"?o.get(a,$(r)):o.request({...a,method:"get"}),post:(a,r,s={})=>typeof a=="string"?o.post(a,r,s):o.request(N(a,"post",r,s)),put:(a,r,s={})=>typeof a=="string"?o.put(a,r,s):o.request(N(a,"put",r,s)),patch:(a,r,s={})=>typeof a=="string"?o.patch(a,r,s):o.request(N(a,"patch",r,s)),delete:(a,r={})=>typeof a=="string"?o.delete(a,$(r)):o.request({...a,method:"delete"})}}},c0=e=>{const t=e.data.data,n=e.data;return{code:e.data.code,accessToken:(t==null?void 0:t.accessToken)??n.accessToken,refreshToken:(t==null?void 0:t.refreshToken)??n.refreshToken,loginInfo:t}},l0=async(e,t,n)=>{var u,c,x,w,g,P,E,k,f,v;const i=((u=e.headers)==null?void 0:u["content-type"])||"";if(!String(i).includes("application/json"))return e.data;const o=await e.data.text();try{const T=JSON.parse(o);if(Number(T.code)===403){const D=C(T.code,n("api.noPermissionOperation","暂无操作权限"),H(t));return(x=(c=t.ui)==null?void 0:c.error)==null||x.call(c,D),(w=t.onBusinessError)==null||w.call(t,{code:T.code,message:D,response:e}),Promise.reject(new Error(D))}if(O(T.code,t.successCodes))return e.data;const R=C(T.code,q(T.code,T.msg||T.message,t.locale,t.lang),H(t));return(P=(g=t.ui)==null?void 0:g.error)==null||P.call(g,R),(E=t.onBusinessError)==null||E.call(t,{code:T.code,message:R,response:e}),Promise.reject(new Error(R))}catch{const T=n("api.exportFailed","导出失败");return(f=(k=t.ui)==null?void 0:k.error)==null||f.call(k,T),(v=t.onHttpError)==null||v.call(t,{message:T,response:e}),Promise.reject(new Error(T))}},u0=(e,t,n)=>{var i,o,u,c,x;if((i=n.onAuthorizationExpired)==null||i.call(n,{payload:e,response:t}),m0(n)){h0(e,n);return}e.expireTime?(u=(o=n.authorization)==null?void 0:o.openExpired)==null||u.call(o,e):(x=(c=n.authorization)==null?void 0:c.open)==null||x.call(c,e)},m0=e=>{var n;if((n=e.authorization)!=null&&n.isInMicroApp)return e.authorization.isInMicroApp();if(!A())return!1;const t=window;return!!(t.__MICRO_APP_ENVIRONMENT__||t.__MICRO_APP_BASE_APPLICATION__)},h0=(e,t)=>{var o,u,c,x;if((o=t.authorization)!=null&&o.dispatchMicroAppEvent){t.authorization.dispatchMicroAppEvent(e);return}if(!A())return;const n={type:"authorization_expired",machineCode:e.machineCode,expireTime:e.expireTime},i=(u=t.authorization)==null?void 0:u.eventCenterName;if(i){const g=window[i];if(typeof(g==null?void 0:g.dispatch)=="function"){g.dispatch({myname:((c=t.authorization)==null?void 0:c.microAppName)??i,data:n});return}}window.dispatchEvent(new CustomEvent(((x=t.authorization)==null?void 0:x.eventName)??J,{detail:n}))},j=(e,t)=>{if(!e||typeof e!="object")return;const n=e;return typeof n[t]=="string"?n[t]:void 0},C=(e,t,n)=>{if(e==null||e==="")return t;const i=Q(n)?B:U,o=Q(n)?U:B,u=String(e);return(i[u]??o[u])||t||i.other||o.other},Q=e=>typeof e=="string"&&e.toLowerCase().startsWith("en"),H=e=>{var t,n,i;return((t=e.getLocale)==null?void 0:t.call(e))??((i=(n=e.locale)==null?void 0:n.getLocale)==null?void 0:i.call(n))??e.lang},F=(e,t,n)=>{const i=e.headers;if(i&&typeof i.set=="function"){i.set(t,String(n));return}e.headers[t]=String(n)},f0=(e,t)=>{Object.entries(t??{}).forEach(([n,i])=>{i!=null&&F(e,n,i)})},p0=e=>Object.entries(e??{}).reduce((t,[n,i])=>(i==null||(t[n]=String(i)),t),{}),g0=(e,t)=>{var n;return t.shouldRefreshToken?t.shouldRefreshToken(e):Number((n=e.data)==null?void 0:n.code)===401},N=(e,t,n,i={})=>({...i,...e,method:t,data:e.data??n??i.data}),$=e=>e?T0(e)?{...e,params:z(e.params)}:{params:z(e)}:{},z=e=>{if(!e)return e;if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const o=new URLSearchParams(e);return o.delete("lang"),o}if(typeof e!="object"||Array.isArray(e))return e;const t=e,{lang:n,...i}=t;return i},y0=new Set(["adapter","auth","baseURL","cancelToken","data","decompress","headers","httpAgent","httpsAgent","maxBodyLength","maxContentLength","method","onDownloadProgress","onUploadProgress","params","paramsSerializer","proxy","responseEncoding","responseType","signal","socketPath","timeout","timeoutErrorMessage","transformRequest","transformResponse","transitional","url","validateStatus","withCredentials","xsrfCookieName","xsrfHeaderName"]),T0=e=>!e||typeof e!="object"||typeof URLSearchParams<"u"&&e instanceof URLSearchParams?!1:Object.keys(e).some(t=>y0.has(t));let I=null;const x0=e=>{const t=K(e);return I=t,t},k0=e=>(I=e,e),S=()=>{if(!I)throw new Error("Request SDK is not initialized. Call setupRequestSdk(...) or install the Vue plugin first.");return I},b0={request:e=>S().request.request(e),get:(e,t)=>S().request.get(e,t),post:(e,t,n)=>S().request.post(e,t,n),put:(e,t,n)=>S().request.put(e,t,n),patch:(e,t,n)=>S().request.patch(e,t,n),delete:(e,t)=>S().request.delete(e,t)},E0=new Proxy({},{get(e,t){return Reflect.get(S().service,t)}});exports.AUTHORIZATION_EXPIRED_EVENT=J;exports.buildAuthHeaderValue=W;exports.createRequestSdk=K;exports.extractI18nParams=G;exports.getBizErrorMsg=q;exports.getDefaultRequestSdk=S;exports.http=E0;exports.isSuccessCode=O;exports.request=b0;exports.setDefaultRequestSdk=k0;exports.setupRequestSdk=x0;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./default-sdk-BiMIVw3K.cjs"),t=require("./adapters/storage-token.cjs");exports.AUTHORIZATION_EXPIRED_EVENT=e.AUTHORIZATION_EXPIRED_EVENT;exports.buildAuthHeaderValue=e.buildAuthHeaderValue;exports.createRequestSdk=e.createRequestSdk;exports.extractI18nParams=e.extractI18nParams;exports.getBizErrorMsg=e.getBizErrorMsg;exports.getDefaultRequestSdk=e.getDefaultRequestSdk;exports.http=e.http;exports.isSuccessCode=e.isSuccessCode;exports.request=e.request;exports.setDefaultRequestSdk=e.setDefaultRequestSdk;exports.setupRequestSdk=e.setupRequestSdk;exports.createStorageTokenAdapter=t.createStorageTokenAdapter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./default-sdk-BPbtZraP.cjs"),t=require("./adapters/storage-token.cjs");exports.AUTHORIZATION_EXPIRED_EVENT=e.AUTHORIZATION_EXPIRED_EVENT;exports.buildAuthHeaderValue=e.buildAuthHeaderValue;exports.createRequestSdk=e.createRequestSdk;exports.extractI18nParams=e.extractI18nParams;exports.getBizErrorMsg=e.getBizErrorMsg;exports.getDefaultRequestSdk=e.getDefaultRequestSdk;exports.http=e.http;exports.isSuccessCode=e.isSuccessCode;exports.request=e.request;exports.setDefaultRequestSdk=e.setDefaultRequestSdk;exports.setupRequestSdk=e.setupRequestSdk;exports.createStorageTokenAdapter=t.createStorageTokenAdapter;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as a, b as t, c as r, e as u, g as d, a as o, h as c, i as R, r as S, s as g, d as k } from "./default-sdk-Cm6i-5y_.js";
1
+ import { A as a, b as t, c as r, e as u, g as d, a as o, h as c, i as R, r as S, s as g, d as k } from "./default-sdk-BDsyZQdl.js";
2
2
  import { createStorageTokenAdapter as q } from "./adapters/storage-token.js";
3
3
  export {
4
4
  a as AUTHORIZATION_EXPIRED_EVENT,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),s=require("../default-sdk-BiMIVw3K.cjs"),u=Symbol("requestSdk"),l=r=>{const e=s.createRequestSdk(r);return{sdk:e,install(t){s.setDefaultRequestSdk(e),t.provide(u,e),t.config.globalProperties.$request=e.request,t.config.globalProperties.$http=e.service}}},n=()=>o.inject(u,null)??s.getDefaultRequestSdk();exports.createRequestSdkPlugin=l;exports.requestSdkKey=u;exports.useRequestSdk=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),s=require("../default-sdk-BPbtZraP.cjs"),u=Symbol("requestSdk"),l=r=>{const e=s.createRequestSdk(r);return{sdk:e,install(t){s.setDefaultRequestSdk(e),t.provide(u,e),t.config.globalProperties.$request=e.request,t.config.globalProperties.$http=e.service}}},n=()=>o.inject(u,null)??s.getDefaultRequestSdk();exports.createRequestSdkPlugin=l;exports.requestSdkKey=u;exports.useRequestSdk=n;
package/dist/vue/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { inject as o } from "vue";
2
- import { c as u, a as l, s as n } from "../default-sdk-Cm6i-5y_.js";
2
+ import { c as u, a as l, s as n } from "../default-sdk-BDsyZQdl.js";
3
3
  const s = Symbol("requestSdk"), a = (r) => {
4
4
  const e = u(r);
5
5
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/http-request-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Reusable axios request SDK for Vue 3 applications.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,3 +0,0 @@
1
- "use strict";const z=require("axios"),Y="System error",X={400:"Invalid request parameters",401:"Unauthorized. Token, username, or password is incorrect.",403:"Access is forbidden.",404:"Network request error. Resource not found.",405:"Network request error. Method not allowed.",408:"Network request timed out.",500:"System error",501:"Network request is not implemented.",502:"Network error.",503:"Service unavailable. The server is overloaded or under maintenance.",504:"Network timeout.",505:"HTTP version is not supported.",507:"The maximum export quantity is 100000.",7e5:"Invalid code [{}]",700001:"The export quantity exceeds the limit. The maximum allowed is [{}].",700002:"The data exceeds [{}] records. Please narrow the query range.",700003:"Device [{}] is offline.",700004:"Device [{}] has no GPS information.",700005:"File already exists. Path: [{}]",700006:"Invalid file name.",700007:"File size exceeds the limit.",700008:"Unsupported file type.",700009:"File is empty.",700010:"Only [{}] files are supported.",700011:"File parsing failed.",700012:"File saving failed.",700013:"No online devices.",700014:"Invalid file path.",700015:"File upload failed.",700016:"File export failed.",700017:"User does not exist.",700018:"File does not exist.",700019:"Parameter is empty.",700020:"Local language is empty.",700021:"Device history data does not exist.",700022:"Device [{}] longitude is empty.",700023:"Device [{}] latitude is empty.",700025:"MD5 algorithm is unavailable.",700026:"Export exception.",700027:"ID is empty.",701e3:"DPD-TDOA raw data is empty.",701001:"DPD-TDOA raw data details are empty.",701002:"TDOA collection frequency is incorrect.",701003:"Algorithm type is empty.",701004:"Flight task ID is empty.",701005:"Target coordinates are empty.",701006:"The number of devices for single collection cannot be less than [{}].",701007:"The number of devices for continuous collection cannot be less than [{}].",701008:"Device reported abnormal gpsTime.",701009:"Failed to correct collection task and record.",701010:"Device code is empty.",701011:"Device [{}] has unfinished collection tasks. Duplicate dispatch is not allowed.",701012:"No warning level matched for area type [{}].",701013:"Failed to store IQ data file.",701014:"Failed to store IQ data file.",701015:"Firmware metadata not found.",701016:"Firmware data is empty.",701017:"Firmware for this device model and version already exists.",701018:"Failed to upload and parse firmware.",701019:"Collection data is empty.",701020:"Collection task ID is empty.",701021:"Failed to save drone reported image.",701022:"Failed to convert drone reported image.",701023:"Device height above ground is invalid.",701024:"Device detection range is invalid.",701025:"Failed to convert drone reported video.",701026:"Failed to save trajectory data.",701027:"Drone [{}] whitelist data has expired and cannot be modified.",701028:"Drone [{}] whitelist data has overlapping time and cannot be added.",701029:"Seconds cannot be negative.",701030:"Start time is empty.",701031:"End time is empty.",701032:"Start time is later than end time.",701033:"End time is earlier than current time.",701034:"Start time and end time are the same.",701035:"Failed to build drone warning data.",701036:"Failed to save drone data.",701040:"Area name already exists.",701041:"Area name is empty.",701052:"There are locked drones. Please unlock them before operating.",701056:"Only hourly or daily grouping is supported.",701057:"Firmware package is damaged or unreadable. Please check the firmware file.",704001:"Event identifier cannot be empty.",704002:"Event type cannot be empty.",704003:"Defense area number cannot be empty.",704004:"Data forwarding endpoint cannot be empty.",704020:"Reporting method cannot be empty.",704021:"Platform code cannot be empty.",704022:"Platform name cannot be empty.",704023:"The defense area does not exist.",704024:"Platform code already exists. Please use another one.",704028:"Currently only MQTT forwarding protocol is supported.",704033:"Connection test failed: [{}]",704034:"Test sending failed: [{}]",704037:"Data forwarding task does not exist.",704040:"Data forwarding endpoint does not exist.",705e3:"Configuration ID cannot be empty.",705001:"System configuration information cannot be empty.",705002:"Configuration value cannot be empty.",705003:"Configuration key cannot be empty.",705004:"Configuration key length cannot exceed [{}] characters.",705005:"Configuration key already exists.",705006:"Configuration does not exist.",1001000001:"Parameter configuration does not exist.",1001000002:"Parameter configuration key is duplicated.",1001000003:"Built-in system parameter configurations cannot be deleted.",1001000004:"Failed to get parameter configuration because hidden configurations are not allowed.",1001003001:"File does not exist.",1001003002:"File is empty.",1001003003:"Unsupported image format.",1001003004:"Image file is too large.",1001003005:"Unable to read image file.",1001006e3:"File configuration does not exist.",1001006001:"This file configuration cannot be deleted because it is the primary configuration.",1002e6:"Incorrect account or password.",1002000001:"Login failed. The account has been disabled.",1002000004:"Incorrect verification code.",1002000005:"Account is not bound. Binding is required.",1002000007:"Phone number does not exist.",1002000008:"Incorrect verification code.",1002001e3:"A menu with this name already exists.",1002001001:"Parent menu does not exist.",1002001002:"Cannot set itself as parent menu.",1002001003:"Menu does not exist.",1002001004:"Child menus exist and cannot be deleted.",1002001005:"Parent menu type must be directory or menu.",1002001006:"A menu with this component name already exists.",1002001007:"Invalid menu subtype.",1002001008:"Menu synchronization failed.",1002001009:"Menu node level exceeds the limit.",1002001010:"Invalid menu UUID.",1002001011:"Parent menu does not meet the specification.",1002002e3:"Role does not exist.",1002002001:"Role name is duplicated.",1002002002:"Role code already exists.",1002002003:"Built-in system roles cannot be operated.",1002002004:"Role has been disabled.",1002002005:"Role identifier cannot be used.",1002002006:"This role cannot be deleted.",1002003e3:"This account is already used. Please change it.",1002003001:"The phone number already exists.",1002003002:"The email address already exists.",1002003003:"User does not exist.",1002003004:"Imported user data cannot be empty.",1002003005:"Old password is incorrect.",1002003006:"This user has been disabled.",1002003008:"Failed to create user. Tenant quota exceeded.",1002003010:"This phone number has not been registered.",1002003011:"Registration is disabled.",1002003012:"This user is enabled and cannot be deleted.",1002003013:"Invalid region code.",1002003014:"Login account is display-only and cannot be edited.",1002003015:"Parsing failed.",1002003016:"Parsing failed: each import cannot exceed 10000 records. Please split the file.",1002003017:"Parsing failed: imported data cannot be empty.",1002003018:"Upload failed: file size exceeds the 10MB limit.",1002003019:"File parsing failed: only .xlsx template files are supported.",1002005e3:"The current position does not exist.",1002005001:"The position is not enabled and cannot be selected.",1002005002:"A position with this name already exists.",1002005003:"A position with this identifier already exists.",1002006001:"The current dictionary type does not exist.",1002006002:"The dictionary type is not enabled and cannot be selected.",1002006003:"Dictionary name already exists.",1002006004:"Dictionary code already exists.",1002006005:"Cannot delete. Dictionary values still exist under this dictionary.",1002006006:"Invalid dictionary synchronization request.",1002007001:"The current dictionary data does not exist.",1002007002:"The dictionary data is not enabled and cannot be selected.",1002007003:"Dictionary key already exists.",1002007004:"Dictionary label already exists.",1002031001:"Authorization has expired.",10021e5:"File service exception. Please check and test the file configuration.",1086001001:"System error.",1086001002:"Request error.",1086001003:"Enum not found.",1086001004:"Invalid parameter.",1086001005:"File is empty.",1086001006:"Invalid format.",1086002001:"Manufacturer code does not exist.",1086002002:"Device is not registered. Please register it first.",1086002003:"Invalid device creation parameters.",1086002004:"Dock or drone device already exists. Please check the SN.",1086002005:"Device does not exist.",1086002006:"Device is offline.",1086003004:"No flight or payload control permission.",1086003005:"Dock is offline.",1086003006:"Drone is offline.",1086003028:"Device is offline. DRC control cannot be performed.",1086003032:"Live stream failed because the device is offline.",1086003033:"Unable to pull the device stream. Please try again.",1086003034:"Live stream type is not supported.",1086004001:'File name cannot contain illegal characters <>:"/',1086004002:"Route does not exist.",1086004003:"This route is used by pending tasks. Please delete the tasks first.",1086004004:"Route creation failed.",1086004005:"Route file name already exists.",1086004006:"The number of waypoints is less than 2.",1086004007:"The number of waypoints is greater than 50.",1086004008:"Route update failed.",1086005001:"Speaker or TTS file does not exist.",1086005002:"Speaker file upload failed.",1086005003:"Speaker file saving failed.",1086005004:"Invalid speaker file format. Only MP3 is supported.",1086005005:"Speaker file size exceeds the limit. A single file cannot exceed 5MB.",1086005006:"Speaker file name is duplicated on this device.",1086008001:"Route name cannot be empty.",1086008002:"Plan name already exists.",1086008003:"Execution time cannot be earlier than current time.",1086008004:"Plan does not exist.",1086008008:"Route task does not exist.",1086008014:"Task report is being generated. Please try again later.",1086009001:"Space name is duplicated.",1086009002:"Invalid parent space.",1086009003:"Detected circular parent space.",1086009004:"Space or child nodes are bound to devices and cannot be deleted.",1086009005:"Space level has reached the maximum limit.",1086009006:"Root node cannot be deleted.",1086009007:"Root node already exists and cannot be created again.",1086009008:"Failed to query monitoring device list.",1500000001:"Failed to initialize platform MQTT client instance.",1500000002:"Failed to connect to MQTT broker.",1500000003:"MQTT connection lost unexpectedly.",1500000004:"instanceName cannot be empty.",1500000005:"Forwarding configuration already exists.",1500000006:"Forwarding configuration does not exist.",1500000008:"Target instance is unavailable: {}",1500000009:"Request instance {} does not match current node {}.",1500000010:"Please disable forwarding configuration before deleting it.",1500000011:"Failed to release MQTT physical connection.",1500000012:"Changing forwarding configuration ownership through update is not allowed.",1500000013:"payloadTransformScript length cannot exceed {} characters.",1500000014:"payloadTransformScript compilation failed: {}",1500000015:"Invalid brokerUrl format. Use mqtt://host:port, mqtts://host:port, tcp://host:port, or ssl://host:port.",other:Y},Z="系统异常",e0={400:"参数错误",401:"用户没有权限(令牌、用户名、密码错误)!",403:"用户得到授权,但是访问是被禁止的。!",404:"网络请求错误,未找到该资源!",405:"网络请求错误,请求方法未允许!",408:"网络请求超时!",500:"系统错误",501:"网络未实现!",502:"网络错误!",503:"服务不可用,服务器暂时过载或维护!",504:"网络超时!",505:"http版本不支持该请求!",507:"超过最大导出数量为100000",7e5:"非法的CODE[{}]",700001:"导出数量超过限制,最大允许导出[{}]条",700002:"数据超过[{}]条,请缩小查询范围",700003:"设备[{}]不在线",700004:"设备[{}]未获取到GPS信息",700005:"文件已存在, 路径[{}]",700006:"文件名非法",700007:"文件大小超出限制",700008:"不支持的文件类型",700009:"文件为空",700010:"仅支持[{}]格式的文件",700011:"文件解析失败",700012:"文件保存失败",700013:"当前无在线设备",700014:"文件路径非法",700015:"文件上传失败",700016:"文件导出失败",700017:"用户不存在",700018:"文件不存在",700019:"参数为空",700020:"当地语言为空",700021:"设备历史数据不存在",700022:"设备[{}]经度为空",700023:"设备[{}]纬度为空",700025:"MD5算法不可用",700026:"导出异常",700027:"ID为空",701e3:"dpd-tdoa原始数据为空",701001:"dpd-tdoa原始数据详情为空",701002:"TDOA采集频率不正确",701003:"算法类型为空",701004:"飞行任务ID为空",701005:"靶标坐标为空",701006:"单次采集设备数量不能小于[{}]台",701007:"连续采集设备数量不能小于[{}]台",701008:"设备上报gpsTime异常",701009:"订正采集任务和采集记录异常",701010:"设备编码为空",701011:"设备[{}]有未完成采集任务,禁止重复下发",701012:"区域类型未匹配到预警等级[{}]",701013:"IQ数据文件存储失败",701014:"IQ数据文件存储失败",701015:"未找到固件元信息",701016:"固件数据为空",701017:"该设备型号和固件版本的固件已存在",701018:"上传解析固件失败",701019:"采集数据为空",701020:"采集任务ID为空",701021:"无人机上报图片保存失败",701022:"无人机上报图片转换失败",701023:"设备相对地面高度非法",701024:"设备侦测范围非法",701025:"无人机上报视频转换失败",701026:"轨迹数据保存失败",701027:"无人机[{}]白名单数据已失效, 禁止修改",701028:"无人机[{}]白名单数据已存在时间交叉, 禁止新增",701029:"秒数不能为负数",701030:"有效时间起为空",701031:"有效时间止为空",701032:"有效时间起大于有效时间止",701033:"有效时间止小于当前时间",701034:"有效时间起止相同",701035:"构建无人机预警数据异常",701036:"保存无人机数据失败",701037:"固件文件访问URL不存在, 固件ID[{}]",701038:"没有找到对应设备型号的设备,无法下发固件升级命令",701039:"设备固件发布状态为空",701040:"区域名称已存在",701041:"区域名称为空",701042:"无人机停飞事件处理推送失败",701043:"无人机通用识别类型为空",701044:"无人机识别类型为空",701045:"DISCERN_PARSE识别类型暂不支持锁定和解锁",701046:"TDOA结果上报事件处理失败, 设备编码[{}]",701047:"仿真日志推送事件处理失败",701048:"单次数据采集少于[{}]个IQ文件",701049:"侦测设备位置信息列表为空",701050:"无人机数据为空",701051:"算法结果是否合并参数为空",701052:"有无人机锁定,请先解锁后操作",701053:"锁定信息序列化失败",701054:"解析锁定信息失败",701055:"更新锁定成功动作失败",701056:"仅支持按小时或按天分组",701057:"固件包文件损坏或无法读取, 请检查固件文件是否符合规范",701058:"固件包中存在多个JSON文件, 请检查固件文件是否符合规范",701059:"固件包中存在多个BIN文件, 请检查固件文件是否符合规范",701060:"固件包中缺少JSON文件, 请检查固件文件是否符合规范",701061:"固件包中缺少BIN文件, 请检查固件文件是否符合规范",704e3:"标准化转发事件不能为空",704001:"事件标识不能为空",704002:"事件类型不能为空",704003:"防区编号不能为空",704004:"数据转发端点不能为空",704005:"待发送消息ID不能为空",704006:"待发送消息不存在",704007:"发送成功的消息不允许重发",704008:"待发送消息ID列表不能为空",704009:"待发送消息关联的端点不存在",704010:"待发送消息关联的主任务不存在",704011:"数据转发任务已禁用,请先启用后再重发",704012:"数据转发任务新增请求不能为空",704013:"数据转发任务更新请求不能为空",704014:"更新时任务ID不能为空",704015:"状态更新请求不能为空",704016:"数据转发任务ID不能为空",704017:"端点ID不能为空",704018:"端点状态请求不能为空",704019:"端点配置不能为空",704020:"上报方式不能为空",704021:"平台编码不能为空",704022:"平台名称不能为空",704023:"所属防区不存在",704024:"平台编码已存在,请更换后重试",704025:"启用数据转发任务前至少需要配置一个端点",704026:"同一任务下服务地址与Topic不允许重复",704027:"启用数据转发任务时至少需要一个启用中的端点",704028:"当前仅支持MQTT转发协议",704029:"消息可靠性仅允许0、1、2",704030:"持久会话配置非法",704031:"至少需要选择一种推送数据类型",704032:"存在不支持的推送数据类型",704033:"测试连接失败: [{}]",704034:"测试发送失败: [{}]",704035:"初始化数据转发MQTT客户端失败: [{}]",704036:"刷新数据转发MQTT客户端失败: [{}]",704037:"数据转发任务不存在",704038:"数据转发任务不能为空",704039:"数据转发任务已被其他用户修改,请刷新后重试",704040:"数据转发端点不存在",704041:"当前主任务已启用,至少需要保留一个启用中的端点",704042:"接口地址不能为空",704043:"Topic不能为空",704044:"MQTT客户端标识不能为空",704045:"接口地址格式非法,请使用tcp://ip:port",704046:"接口地址中的IP非法",704047:"接口地址中的端口非法,范围为1-65535",705e3:"配置ID不能为空",705001:"系统配置信息不能为空",705002:"配置值不能为空",705003:"配置键不能为空",705004:"配置键长度不能超过[{}]个字符",705005:"配置键已存在",705006:"配置不存在",1001000001:"参数配置不存在",1001000002:"参数配置 key 重复",1001000003:"不能删除类型为系统内置的参数配置",1001000004:"获取参数配置失败,原因:不允许获取不可见配置",1001003001:"文件不存在",1001003002:"文件为空",1001003003:"不支持的图片格式",1001003004:"图片文件过大",1001003005:"无法读取图片文件",1001006e3:"文件配置不存在",1001006001:"该文件配置不允许删除,原因:它是主配置,删除会导致无法上传文件",1002e6:"账号或密码错误!",1002000001:"登录失败,账号已停用!",1002000004:"验证码不正确",1002000005:"未绑定账号,需要进行绑定",1002000007:"手机号不存在",1002000008:"验证码不正确",1002001e3:"已经存在该名字的菜单",1002001001:"父菜单不存在",1002001002:"不能设置自己为父菜单",1002001003:"菜单不存在",1002001004:"存在子菜单,无法删除",1002001005:"父菜单的类型必须是目录或者菜单",1002001006:"已经存在该组件名的菜单",1002001007:"菜单子类型非法",1002001008:"菜单同步失败",1002001009:"菜单子节点层级超过限制",1002001010:"菜单 UUID 非法",1002001011:"父菜单不符合规范",1002002e3:"角色不存在",1002002001:"角色名称重复",1002002002:"角色编码已存在",1002002003:"不能操作类型为系统内置的角色",1002002004:"角色已被禁用",1002002005:"角色标识不能使用",1002002006:"不允许删除该角色",1002003e3:"该账号已被占用,请更换!",1002003001:"输入手机号已存在!",1002003002:"输入电子邮箱已存在!",1002003003:"用户不存在",1002003004:"导入用户数据不能为空!",1002003005:"旧密码输入错误!",1002003006:"该用户已被禁用",1002003008:"创建用户失败,超过租户最大租户配额",1002003010:"该手机号尚未注册",1002003011:"注册功能已关闭",1002003012:"该用户处于开启状态,不能删除",1002003013:"地区编码错误",1002003014:"登录账号仅展示,不允许编辑",1002003015:"解析失败",1002003016:"解析失败:单次导入数据不得超过10000条,请拆分文件!",1002003017:"解析失败:导入数据不能为空!",1002003018:"上传失败:文件大小超过 10MB 上限!",1002003019:"文件解析失败:仅支持上传 .xlsx 模板文件,请检查后重试!",1002005e3:"当前岗位不存在",1002005001:"岗位不处于开启状态,不允许选择",1002005002:"已经存在该名字的岗位",1002005003:"已经存在该标识的岗位",1002006001:"当前字典类型不存在",1002006002:"字典类型不处于开启状态,不允许选择",1002006003:"字典名称已存在",1002006004:"字典编码已存在",1002006005:"无法删除!当前字典下仍存在字典值!",1002006006:"字典同步请求不合法",1002007001:"当前字典数据不存在",1002007002:"字典数据不处于开启状态,不允许选择",1002007003:"字典键值已存在",1002007004:"字典标签已存在",1002031001:"授权已过期",10021e5:"文件服务异常,请检查并测试文件配置是否正确",1086001001:"系统错误",1086001002:"请求错误",1086001003:"枚举未找到",1086001004:"参数无效",1086001005:"文件为空",1086001006:"格式错误",1086002001:"制造商代码不存在",1086002002:"设备未注册,请先注册后再试!",1086002003:"设备创建参数无效",1086002004:"机库/无人机设备已存在,请检查SN码",1086002005:"设备不存在",1086002006:"设备离线",1086002007:"创建设备型号失败",1086002008:"查询所有列表失败",1086002009:"从父代码查询列表失败",1086002010:"远程调试操作失败",1086002011:"设备未注册远程调试",1086002012:"设备离线,无法进行远程调试",1086002013:"远程调试通信超时",1086002014:"远程调试MQTT错误",1086003001:"飞机调试未知错误",1086003002:"飞机已在返航中",1086003003:"飞机已在调试模式",1086003004:"无飞行/挂载控制权限",1086003005:"机库离线",1086003006:"无人机离线",1086003007:"机库控制指令报错",1086003008:"直点飞行启动报错",1086003009:"直点飞行停止报错",1086003010:"正在执行指令飞行操作,无法执行指点飞行,请稍后重试",1086003011:"正在执行指令飞行操作,无法执行航线下发,请稍后重试",1086003012:"正在执行自动降落/返航操作,无法执行指点飞行",1086003013:"正在执行自动降落/返航操作,无法执行航线下发",1086003014:"下发空中航线报错,具体错误原因:",1086003015:"下发空中航线报错,没有对应一键起飞参数",1086003016:"飞行基础配置不存在",1086003017:"无人机无法起飞,原因是",1086003018:"获取飞行控制权失败",1086003019:"获取负载控制权失败",1086003020:"负载控制命令执行报错",1086003021:"飞行基础配置未找到",1086003022:"保存飞行基础配置失败",1086003023:"进入DRC模式失败",1086003024:"DRC摇杆控制失败",1086003025:"DRC急停失败",1086003026:"DRC紧急迫降失败",1086003027:"设备离线,无法执行DRC控制",1086003028:"DRC探照灯模式设置失败",1086003029:"DRC探照灯亮度设置失败",1086003030:"DRC探照灯角度微调失败",1086003031:"DRC探照灯校准失败",1086003032:"直播流失败原因:设备离线",1086003033:"设备拉不到流,请重试",1086003034:"直播流类型不支持",1086004001:'文件名不能包含非法字符 <>:"/',1086004002:"航线不存在",1086004003:"存在有待执行任务使用该航线,请删除任务后重试!",1086004004:"航线创建失败",1086004005:"航线文件名称已存在",1086004006:"航点数小于2",1086004007:"航点数大于50",1086004008:"航线更新失败",1086004009:"全局返航高度必须为正整数",1086004010:"全局返航高度必须在20-1500之间",1086005001:"扬声器/tts文件不存在",1086005002:"扬声器文件上传失败",1086005003:"扬声器文件保存失败",1086005004:"扬声器文件格式无效,仅支持 MP3 格式",1086005005:"扬声器文件大小超出限制,单个文件大小不得超过 5MB",1086005006:"扬声器文件名重复,该设备已存在同名文件",1086005007:"扬声器文件参数无效",1086005008:"当文件类型为 0 时,必须提供录音文件",1086005009:"当文件类型为 1 时,必须提供扬声器内容",1086005010:"喊话文件超过最大限制数",1086005011:"当前文件状态为下载或传输中,不支持切换文件播放",1086005012:"扬声器未同步到设备,请稍后重试",1086005013:"MP3格式转PCM格式失败,请重新上传MP3文件后重试",1086005014:"录音内容为空",1086005015:"媒体文件不存在",1086005016:"媒体文件删除失败",1086005017:"媒体文件下载失败",1086005018:"文件路径不能为空",1086005019:"OSS文件删除失败",1086005020:"文件压缩失败",1086006001:"http服务调用失败",1086006002:"算法服务未配置",1086006003:"请等待算法服务处理完成!",1086007001:"地图标注不存在",1086008001:"航线名称不能为空",1086008002:"计划名称已存在",1086008003:"执行时间不能早于当前时间",1086008004:"计划不存在",1086008005:"方案计划不存在可执行任务",1086008006:"飞机尚未进入航线或已退出航线,无法暂停",1086008007:"不支持的航线任务控制指令",1086008008:"航线任务不存在",1086008009:"恢复航线任务失败",1086008010:"任务状态不为执行中,暂停失败",1086008011:"任务状态不支持终止",1086008012:"取消航线任务失败",1086008013:"飞机返航失败",1086008014:"任务报告生成中,请稍后重试",1086009001:"空间名称重复",1086009002:"空间父级无效",1086009003:"检测到空间父级循环",1086009004:"空间或其子节点已绑定设备,不允许删除",1086009005:"空间层级已达到最大限制,无法继续新增",1086009006:"根节点不允许删除",1086009007:"根节点已存在,不能重复创建根节点",1086009008:"查询监控设备列表错误",1086010001:"飞行区不存在",1500000001:"初始化平台 MQTT 客户端实例异常",1500000002:"与 MQTT 代理服务器连接失败",1500000003:"MQTT 连接意外丢失",1500000004:"instanceName 不能为空",1500000005:"转发配置已存在",1500000006:"转发配置不存在",1500000008:"目标实例不可用:{}",1500000009:"请求实例 {} 与当前节点 {} 不匹配",1500000010:"请先停用转发配置再删除",1500000011:"MQTT 物理连接释放失败",1500000012:"不允许通过更新变更转发配置归属实例",1500000013:"payloadTransformScript 长度不能超过 {} 字符",1500000014:"payloadTransformScript 编译失败:{}",1500000015:"brokerUrl 格式非法,需使用 mqtt://host:port、mqtts://host:port、tcp://host:port 或 ssl://host:port",other:Z},t0=[0,200],r0={"api.accountExpired":"Your account has expired. Please log in again.","api.permissionExpiredTitle":"Permission expired","api.permissionExpiredContent":"Your account has expired. Please log in again.","api.permissionExpiredOkText":"OK","api.networkExceptionMsg":"Network connection error","api.systemException":"System error","api.noPermissionOperation":"No permission to perform this operation","api.exportFailed":"Export failed","api.tokenExpired":"Your account has expired. Please log in again."},H=(e,t,n)=>a0(n)?r0[e]??t??e:t??e,a0=e=>typeof e=="string"&&e.toLowerCase().startsWith("en"),$=e=>{var o,u,c;if(typeof e!="string")return;const t=((o=e.match(/【([^】]+)】/))==null?void 0:o[1])||((u=e.match(/\(([^)]+)\)/))==null?void 0:u[1]),n=(c=e.match(/原因[::]\s*(.+)$/))==null?void 0:c[1],i={};return t&&(i.value=t),n&&(i.reason=n),Object.keys(i).length?i:void 0},n0=(e,t)=>(n,i,o)=>{var c;const u=(c=e==null?void 0:e.translate)==null?void 0:c.call(e,n,i,o);return u&&u!==n?u:H(n,i,t)},q=(e,t,n,i)=>{var x,w;const u=`api.errMsg${String(e??"")}`,c=(x=n==null?void 0:n.translate)==null?void 0:x.call(n,u,void 0,$(t));return c&&c!==u?c:typeof t=="string"&&t||((w=n==null?void 0:n.translate)==null?void 0:w.call(n,"api.systemException","系统异常"))||H("api.systemException","系统异常",i)},i0=(e,t,n="/admin-api")=>typeof e=="function"?e(t):e??`${n}/system/auth/refresh-token?refreshToken=${t??""}`,s0=e=>typeof e=="function"?e():e??"/login",O=(e,t=t0)=>t.some(n=>String(n)===String(e)),V=(e,t="Bearer")=>typeof t=="function"?t(e):t?`${t} ${e}`:e,I=()=>typeof window<"u"&&typeof document<"u",G="http-request-sdk:authorization-expired",_=e0,L=X,W=(e={})=>{const t=n0(e.locale,e.lang);let n=!1,i=null;const o=z.create({baseURL:e.baseURL??"/admin-api",timeout:e.timeout??3e4,validateStatus:a=>a>=200&&a<300||a===400,headers:{"Content-Type":"application/json;charset=UTF-8"},...e.axiosConfig}),u=()=>{var h,y,p,l;const a=typeof e.getAccessToken=="function",r=typeof((h=e.token)==null?void 0:h.getAccessToken)=="function",s=((y=e.getAccessToken)==null?void 0:y.call(e))??((l=(p=e.token)==null?void 0:p.getAccessToken)==null?void 0:l.call(p));return console.info("[http-request-sdk][token]","access-token:resolve",{hasGetAccessToken:a,hasTokenGetAccessToken:r,hasToken:!!s,tokenLength:(s==null?void 0:s.length)??0}),s},c=(a,r)=>{console.info("[http-request-sdk][token]",a,{hasToken:!!r,tokenLength:(r==null?void 0:r.length)??0})},x=()=>{var a,r,s;return((a=e.getLocale)==null?void 0:a.call(e))??((s=(r=e.locale)==null?void 0:r.getLocale)==null?void 0:s.call(r))},w=()=>x()??e.lang,g=(a,r)=>C(a,r,w()),D=a=>{var r;(r=e.onBusinessError)==null||r.call(e,a)},E=a=>{var r;(r=e.onHttpError)==null||r.call(e,a)},k=a=>{var r,s;(s=(r=e.ui)==null?void 0:r.error)==null||s.call(r,a)},f=(a,r)=>{console.info("[http-request-sdk][permission-expired]",a,r??{})},v=()=>t("api.accountExpired","您的账号已失效,请重新登录"),T=async a=>{var y,p;const r={...a,message:v()};if(f("triggerTokenExpired:start",{code:r.code,message:r.message,hasShowPermissionExpired:!!((y=e.ui)!=null&&y.showPermissionExpired),modalVisible:n}),n){f("triggerTokenExpired:skip-visible",{code:r.code});return}const s=()=>{n=!1,f("modal:visible-reset",{code:r.code})},h=async()=>{var l,m,d,b;f("modal:onOk:start",{code:r.code,hasOnTokenExpired:!!e.onTokenExpired});try{e.onTokenExpired?await e.onTokenExpired(r):(await((m=(l=e.token)==null?void 0:l.logout)==null?void 0:m.call(l)),(b=(d=e.token)==null?void 0:d.clearToken)==null||b.call(d),I()&&(window.location.href=s0(e.loginUrl))),s(),f("modal:onOk:success",{code:r.code})}catch(M){f("modal:onOk:error",{code:r.code,error:M}),s()}};if(n=!0,f("modal:visible-set",{code:r.code}),(p=e.ui)!=null&&p.showPermissionExpired){f("modal:showPermissionExpired:call",{code:r.code}),e.ui.showPermissionExpired({title:t("api.permissionExpiredTitle","权限失效提醒"),content:r.message,okText:t("api.permissionExpiredOkText","我知道了"),onOk:h,onCancel:s});return}if(I()){f("modal:adapter-missing:native-alert",{code:r.code}),window.alert(`${t("api.permissionExpiredTitle","权限失效提醒")}
2
-
3
- ${r.message}`),await h();return}f("modal:adapter-missing:run-onOk-without-browser",{code:r.code}),await h()},P=a=>{var r,s,h,y,p;if(a)return a.accessToken&&((s=(r=e.token)==null?void 0:r.setToken)==null||s.call(r,a.accessToken)),a.refreshToken&&((y=(h=e.token)==null?void 0:h.setRefreshToken)==null||y.call(h,a.refreshToken)),(p=e.onRefreshTokenSuccess)==null||p.call(e,a),a.loginInfo},R=async()=>{var h,y,p,l,m,d;if(e.refreshAccessToken){const b=(y=(h=e.token)==null?void 0:h.getRefreshToken)==null?void 0:y.call(h);c("refresh-token:custom-get-refresh-token",b);const M=await e.refreshAccessToken({refreshToken:b,service:o});return P(M)}const a=(l=(p=e.token)==null?void 0:p.getRefreshToken)==null?void 0:l.call(p);c("refresh-token:get-refresh-token",a);const r=await z.post(i0(e.refreshTokenUrl,a,e.baseURL??"/admin-api"),void 0,{headers:h0(e.headers)}),s=((d=(m=e.token)==null?void 0:m.normalizeRefreshResponse)==null?void 0:d.call(m,r))??o0(r);if(s.code===401||s.code===400)throw new Error(v());return P(s)},J=()=>(i||(i=R().finally(()=>{i=null})),i);o.interceptors.request.use(a=>{const r=u();c("request:get-access-token",r);const s=x();return r&&F(a,e.authHeaderName??"Authorization",V(r,e.authScheme)),s&&F(a,e.localeHeaderName??"Accept-Language",s),m0(a,e.headers),a},a=>{var r;return(r=e.onRequestError)==null||r.call(e,a),Promise.reject(a)});const K=(async a=>{var m;if(a.config.responseType==="blob")return d0(a,e,t);if(a.status!==200&&a.status!==400){const d=g((m=a.data)==null?void 0:m.code,t("api.networkExceptionMsg","网络连接异常"));return k(d),E({message:d,response:a}),Promise.reject(new Error(d))}const{code:r,msg:s,message:h,data:y}=a.data,l=s||h||t("api.systemException","系统异常");if(Number(r)===400){const d=v();return f("response:code-400:show-modal",{httpStatus:a.status,code:r,message:d,url:a.config.url}),await T({code:r,message:d,response:a}),D({code:r,message:d,response:a}),Promise.reject(new Error(d))}if(f0(a,e)){f("response:should-refresh-token",{httpStatus:a.status,code:r,message:l,url:a.config.url});const d=a.config;if(d._retry){const b=v();return f("response:retry-already-used",{code:r,url:a.config.url}),await T({code:r,message:b,response:a}),Promise.reject(new Error(b))}d._retry=!0;try{return f("refresh-token:start",{code:r,url:a.config.url}),await J(),f("refresh-token:success:retry-request",{code:r,url:a.config.url}),o.request(d)}catch(b){const M=v();return f("refresh-token:error:trigger-modal",{code:r,url:a.config.url,error:b}),await T({code:r,message:M,response:a,error:b}),Promise.reject(new Error(M))}}if(Number(r)===403){const d=g(r,t("api.noPermissionOperation","暂无操作权限"));return k(d),D({code:r,message:d,response:a}),Promise.reject(new Error(d))}if(Number(r)===510){const d={machineCode:U(y,"machineCode"),expireTime:U(y,"expireTime"),rawData:y};c0(d,a,e);return}if(Number(r)===1002031003)return D({code:r,message:l,response:a}),Promise.reject(new Error(l));if(!O(r,e.successCodes)){const d=g(r,q(r,l,e.locale,e.lang));return k(d),D({code:r,message:d,response:a}),Promise.reject(new Error(d))}return e.transformResponse?e.transformResponse(a.data):e.unwrapData?a.data.data:a.data});return o.interceptors.response.use(K,a=>{var s,h,y,p;const{response:r}=a;if(r&&((s=r.config)==null?void 0:s.responseType)==="blob"&&typeof Blob<"u"&&r.data instanceof Blob)r.data.text().then(l=>{try{const m=JSON.parse(l),d=q(m.code,m.msg||m.message,e.locale,e.lang);Number(m.code)===403?k(g(m.code,t("api.noPermissionOperation","暂无操作权限"))):k(g(m.code,d||t("api.exportFailed","导出失败"))),E({code:m.code,message:g(m.code,d||t("api.exportFailed","导出失败")),response:r,error:a})}catch{const m=t("api.exportFailed","导出失败");k(m),E({message:m,response:r,error:a})}});else if((r==null?void 0:r.status)===403){const l=g((h=r.data)==null?void 0:h.code,t("api.noPermissionOperation","暂无操作权限"));k(l),E({code:403,message:l,response:r,error:a})}else if(r){const l=g((y=r.data)==null?void 0:y.code,t("api.networkExceptionMsg","网络连接异常"));k(l),E({code:r==null?void 0:r.status,message:l,response:r,error:a})}else{const l=t("api.networkExceptionMsg","网络连接异常");k(l),E({message:l,error:a})}return(p=e.onResponseError)==null||p.call(e,a),Promise.reject(a)}),{service:o,refreshToken:R,request:{request:a=>o.request(a),get:(a,r={})=>typeof a=="string"?o.get(a,Q(r)):o.request({...a,method:"get"}),post:(a,r,s={})=>typeof a=="string"?o.post(a,r,s):o.request(N(a,"post",r,s)),put:(a,r,s={})=>typeof a=="string"?o.put(a,r,s):o.request(N(a,"put",r,s)),patch:(a,r,s={})=>typeof a=="string"?o.patch(a,r,s):o.request(N(a,"patch",r,s)),delete:(a,r={})=>typeof a=="string"?o.delete(a,Q(r)):o.request({...a,method:"delete"})}}},o0=e=>{const t=e.data.data,n=e.data;return{code:e.data.code,accessToken:(t==null?void 0:t.accessToken)??n.accessToken,refreshToken:(t==null?void 0:t.refreshToken)??n.refreshToken,loginInfo:t}},d0=async(e,t,n)=>{var u,c,x,w,g,D,E,k,f,v;const i=((u=e.headers)==null?void 0:u["content-type"])||"";if(!String(i).includes("application/json"))return e.data;const o=await e.data.text();try{const T=JSON.parse(o);if(Number(T.code)===403){const R=C(T.code,n("api.noPermissionOperation","暂无操作权限"),j(t));return(x=(c=t.ui)==null?void 0:c.error)==null||x.call(c,R),(w=t.onBusinessError)==null||w.call(t,{code:T.code,message:R,response:e}),Promise.reject(new Error(R))}if(O(T.code,t.successCodes))return e.data;const P=C(T.code,q(T.code,T.msg||T.message,t.locale,t.lang),j(t));return(D=(g=t.ui)==null?void 0:g.error)==null||D.call(g,P),(E=t.onBusinessError)==null||E.call(t,{code:T.code,message:P,response:e}),Promise.reject(new Error(P))}catch{const T=n("api.exportFailed","导出失败");return(f=(k=t.ui)==null?void 0:k.error)==null||f.call(k,T),(v=t.onHttpError)==null||v.call(t,{message:T,response:e}),Promise.reject(new Error(T))}},c0=(e,t,n)=>{var i,o,u,c,x;if((i=n.onAuthorizationExpired)==null||i.call(n,{payload:e,response:t}),l0(n)){u0(e,n);return}e.expireTime?(u=(o=n.authorization)==null?void 0:o.openExpired)==null||u.call(o,e):(x=(c=n.authorization)==null?void 0:c.open)==null||x.call(c,e)},l0=e=>{var n;if((n=e.authorization)!=null&&n.isInMicroApp)return e.authorization.isInMicroApp();if(!I())return!1;const t=window;return!!(t.__MICRO_APP_ENVIRONMENT__||t.__MICRO_APP_BASE_APPLICATION__)},u0=(e,t)=>{var o,u,c,x;if((o=t.authorization)!=null&&o.dispatchMicroAppEvent){t.authorization.dispatchMicroAppEvent(e);return}if(!I())return;const n={type:"authorization_expired",machineCode:e.machineCode,expireTime:e.expireTime},i=(u=t.authorization)==null?void 0:u.eventCenterName;if(i){const g=window[i];if(typeof(g==null?void 0:g.dispatch)=="function"){g.dispatch({myname:((c=t.authorization)==null?void 0:c.microAppName)??i,data:n});return}}window.dispatchEvent(new CustomEvent(((x=t.authorization)==null?void 0:x.eventName)??G,{detail:n}))},U=(e,t)=>{if(!e||typeof e!="object")return;const n=e;return typeof n[t]=="string"?n[t]:void 0},C=(e,t,n)=>{if(e==null||e==="")return t;const i=B(n)?L:_,o=B(n)?_:L,u=String(e);return(i[u]??o[u])||t||i.other||o.other},B=e=>typeof e=="string"&&e.toLowerCase().startsWith("en"),j=e=>{var t,n,i;return((t=e.getLocale)==null?void 0:t.call(e))??((i=(n=e.locale)==null?void 0:n.getLocale)==null?void 0:i.call(n))??e.lang},F=(e,t,n)=>{const i=e.headers;if(i&&typeof i.set=="function"){i.set(t,String(n));return}e.headers[t]=String(n)},m0=(e,t)=>{Object.entries(t??{}).forEach(([n,i])=>{i!=null&&F(e,n,i)})},h0=e=>Object.entries(e??{}).reduce((t,[n,i])=>(i==null||(t[n]=String(i)),t),{}),f0=(e,t)=>{var n;return t.shouldRefreshToken?t.shouldRefreshToken(e):Number((n=e.data)==null?void 0:n.code)===401},N=(e,t,n,i={})=>({...i,...e,method:t,data:e.data??n??i.data}),Q=e=>e?g0(e)?e:{params:e}:{},p0=new Set(["adapter","auth","baseURL","cancelToken","data","decompress","headers","httpAgent","httpsAgent","maxBodyLength","maxContentLength","method","onDownloadProgress","onUploadProgress","params","paramsSerializer","proxy","responseEncoding","responseType","signal","socketPath","timeout","timeoutErrorMessage","transformRequest","transformResponse","transitional","url","validateStatus","withCredentials","xsrfCookieName","xsrfHeaderName"]),g0=e=>!e||typeof e!="object"||typeof URLSearchParams<"u"&&e instanceof URLSearchParams?!1:Object.keys(e).some(t=>p0.has(t));let A=null;const y0=e=>{const t=W(e);return A=t,t},T0=e=>(A=e,e),S=()=>{if(!A)throw new Error("Request SDK is not initialized. Call setupRequestSdk(...) or install the Vue plugin first.");return A},x0={request:e=>S().request.request(e),get:(e,t)=>S().request.get(e,t),post:(e,t,n)=>S().request.post(e,t,n),put:(e,t,n)=>S().request.put(e,t,n),patch:(e,t,n)=>S().request.patch(e,t,n),delete:(e,t)=>S().request.delete(e,t)},k0=new Proxy({},{get(e,t){return Reflect.get(S().service,t)}});exports.AUTHORIZATION_EXPIRED_EVENT=G;exports.buildAuthHeaderValue=V;exports.createRequestSdk=W;exports.extractI18nParams=$;exports.getBizErrorMsg=q;exports.getDefaultRequestSdk=S;exports.http=k0;exports.isSuccessCode=O;exports.request=x0;exports.setDefaultRequestSdk=T0;exports.setupRequestSdk=y0;