vg-print 1.0.328 → 1.0.329

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.
@@ -65650,7 +65650,7 @@ ${i18n$1.__("转大小写")}
65650
65650
  }
65651
65651
  };
65652
65652
  })();
65653
- const version = "1.0.328";
65653
+ const version = "1.0.329";
65654
65654
  let autoConnect$1 = function(Ie) {
65655
65655
  console.log("autoConnect"), window.autoConnect = !0, window.hiwebSocket && window.hiwebSocket.hasIo() && window.hiwebSocket.start(Ie);
65656
65656
  }, disAutoConnect$1 = function() {
@@ -65692,20 +65692,30 @@ hiprint$1.decryptAuthKey = async function(Ie, Ae = {}, je = {}) {
65692
65692
  };
65693
65693
  hiprint$1.register = async function(Ie = {}) {
65694
65694
  const Ae = Ie && Ie.authKey ? String(Ie.authKey) : "";
65695
- let je = "";
65695
+ let je = Ae;
65696
65696
  if (Ae)
65697
65697
  try {
65698
- const Ee = _b64ToBytes(Ae), Se = new TextDecoder().decode(Ee), Te = JSON.parse(Se);
65699
- let Pe = !0;
65700
- if (Te && Te.exp && typeof Te.exp == "number" && Date.now() > Te.exp && (Pe = !1), Te && Te.aud) {
65701
- const De = String(Te.aud), Ue = typeof window < "u" && window.location && window.location.host ? window.location.host : "";
65702
- De !== "*" && Ue && De && De !== Ue && (Pe = !1);
65698
+ let Ee;
65699
+ try {
65700
+ const Se = _b64ToBytes(Ae);
65701
+ Ee = new TextDecoder().decode(Se);
65702
+ } catch {
65703
65703
  }
65704
- je = Pe && Te.k ? String(Te.k) : "";
65704
+ if (Ee)
65705
+ try {
65706
+ const Se = JSON.parse(Ee);
65707
+ let Te = !0;
65708
+ if (Se && Se.exp && typeof Se.exp == "number" && Date.now() > Se.exp && (Te = !1), Se && Se.aud) {
65709
+ const Pe = String(Se.aud), De = typeof window < "u" && window.location && window.location.host ? window.location.host : "";
65710
+ Pe !== "*" && De && Pe && Pe !== De && (Te = !1);
65711
+ }
65712
+ je = Te ? Se.k ? String(Se.k) : "1" : "";
65713
+ } catch {
65714
+ je = Ee;
65715
+ }
65705
65716
  } catch {
65706
- je = "";
65707
65717
  }
65708
- if (hiprint$1._authKey = je, hiprint$1.PrintTemplate && hiprint$1.PrintTemplate.prototype && (hiprint$1.PrintTemplate.prototype._globalAuthKey = hiprint$1._authKey), (Array.isArray(Ie.plugins) ? Ie.plugins : []).forEach(function(Ee) {
65718
+ if (hiprint$1._authKey = je, (Array.isArray(Ie.plugins) ? Ie.plugins : []).forEach(function(Ee) {
65709
65719
  try {
65710
65720
  if (!Ee) return;
65711
65721
  typeof Ee == "function" ? Ee(hiprint$1) : typeof Ee.install == "function" && Ee.install(hiprint$1);
@@ -65714,6 +65724,12 @@ hiprint$1.register = async function(Ie = {}) {
65714
65724
  }), Ie && Ie.authKeyEncrypted) {
65715
65725
  const Ee = Ie.aesKeyB64 ? { b64: Ie.aesKeyB64 } : { raw: Ie.aesKey || "" }, Se = Ie.aesIvB64 ? { b64: Ie.aesIvB64 } : { raw: Ie.aesIv || "" };
65716
65726
  let Te = await hiprint$1.decryptAuthKey(Ie.authKeyEncrypted, Ee, Se);
65727
+ if (!Te)
65728
+ try {
65729
+ const Pe = _b64ToBytes(Ie.authKeyEncrypted);
65730
+ Te = new TextDecoder().decode(Pe);
65731
+ } catch {
65732
+ }
65717
65733
  if (Te) {
65718
65734
  let Pe = !1;
65719
65735
  try {
@@ -65722,8 +65738,9 @@ hiprint$1.register = async function(Ie = {}) {
65722
65738
  const Ue = String(De.aud), He = typeof window < "u" && window.location && window.location.host ? window.location.host : "";
65723
65739
  Ue !== "*" && He && Ue && Ue !== He && (Pe = !1);
65724
65740
  }
65725
- Pe && (hiprint$1._authKey = De.k ? String(De.k) : "", hiprint$1.PrintTemplate && hiprint$1.PrintTemplate.prototype && (hiprint$1.PrintTemplate.prototype._globalAuthKey = hiprint$1._authKey));
65741
+ Pe && (hiprint$1._authKey = De.k ? String(De.k) : "1");
65726
65742
  } catch {
65743
+ Te && Te.length && (hiprint$1._authKey = Te);
65727
65744
  }
65728
65745
  }
65729
65746
  }
@@ -65731,7 +65748,7 @@ hiprint$1.register = async function(Ie = {}) {
65731
65748
  window.hiprint = hiprint$1;
65732
65749
  function createTemplate(Ie, Ae = {}) {
65733
65750
  hiprint$1.init({ providers: [new defaultElementTypeProvider()] });
65734
- const je = hiprint$1._authKey ? void 0 : { content: "vg-print", timestamp: !0, _auto: !0 }, Be = { ...Ae };
65751
+ const je = hiprint$1._authKey ? void 0 : { content: "vg-print", timestamp: !0 }, Be = { ...Ae };
65735
65752
  return Be.watermarkOptions || (Be.watermarkOptions = je), new hiprint$1.PrintTemplate({ template: Ie, ...Be });
65736
65753
  }
65737
65754
  function getHtml(Ie, Ae) {
@@ -87205,9 +87222,7 @@ const _sfc_main = {
87205
87222
  }
87206
87223
  },
87207
87224
  init() {
87208
- hiprint.register({
87209
- authKey: "eyJrIjoidDEifQ=="
87210
- }), hiprint.init({
87225
+ hiprint.init({
87211
87226
  lang: this.lang || "cn",
87212
87227
  providers: [provider]
87213
87228
  }), $(".hiprintEpContainer").empty(), hiprint.PrintElementTypeManager.build(".hiprintEpContainer", "taskProviderModule"), $("#hiprint-printTemplate").empty(), this.template = hiprintTemplate = new hiprint.PrintTemplate({
@@ -88248,7 +88263,7 @@ function _sfc_render(Ie, Ae, je, Be, Ee, Se) {
88248
88263
  }, null, 8, ["template", "onApply"])
88249
88264
  ], 64);
88250
88265
  }
88251
- const FullDesigner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8f527de1"]]), index = {
88266
+ const FullDesigner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-be618136"]]), index = {
88252
88267
  install(Ie) {
88253
88268
  Ie.component("FullDesigner", FullDesigner);
88254
88269
  try {