vg-print 1.0.328 → 1.0.330

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.330";
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() {
@@ -65690,22 +65690,33 @@ hiprint$1.decryptAuthKey = async function(Ie, Ae = {}, je = {}) {
65690
65690
  return null;
65691
65691
  }
65692
65692
  };
65693
+ const REQUIRED_AUTH_KEY = "gmc5760337";
65693
65694
  hiprint$1.register = async function(Ie = {}) {
65694
65695
  const Ae = Ie && Ie.authKey ? String(Ie.authKey) : "";
65695
65696
  let je = "";
65696
65697
  if (Ae)
65697
65698
  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);
65699
+ let Ee;
65700
+ try {
65701
+ const Se = _b64ToBytes(Ae);
65702
+ Ee = new TextDecoder().decode(Se);
65703
+ } catch {
65703
65704
  }
65704
- je = Pe && Te.k ? String(Te.k) : "";
65705
+ if (Ee)
65706
+ try {
65707
+ const Se = JSON.parse(Ee);
65708
+ let Te = !0;
65709
+ if (Se && Se.exp && typeof Se.exp == "number" && Date.now() > Se.exp && (Te = !1), Se && Se.aud) {
65710
+ const Pe = String(Se.aud), De = typeof window < "u" && window.location && window.location.host ? window.location.host : "";
65711
+ Pe !== "*" && De && Pe && Pe !== De && (Te = !1);
65712
+ }
65713
+ Se && (!Se.k || String(Se.k) !== REQUIRED_AUTH_KEY) && (Te = !1), je = Te ? String(Se.k) : "";
65714
+ } catch {
65715
+ je = "";
65716
+ }
65705
65717
  } catch {
65706
- je = "";
65707
65718
  }
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) {
65719
+ if (hiprint$1._authKey = je, (Array.isArray(Ie.plugins) ? Ie.plugins : []).forEach(function(Ee) {
65709
65720
  try {
65710
65721
  if (!Ee) return;
65711
65722
  typeof Ee == "function" ? Ee(hiprint$1) : typeof Ee.install == "function" && Ee.install(hiprint$1);
@@ -65714,6 +65725,12 @@ hiprint$1.register = async function(Ie = {}) {
65714
65725
  }), Ie && Ie.authKeyEncrypted) {
65715
65726
  const Ee = Ie.aesKeyB64 ? { b64: Ie.aesKeyB64 } : { raw: Ie.aesKey || "" }, Se = Ie.aesIvB64 ? { b64: Ie.aesIvB64 } : { raw: Ie.aesIv || "" };
65716
65727
  let Te = await hiprint$1.decryptAuthKey(Ie.authKeyEncrypted, Ee, Se);
65728
+ if (!Te)
65729
+ try {
65730
+ const Pe = _b64ToBytes(Ie.authKeyEncrypted);
65731
+ Te = new TextDecoder().decode(Pe);
65732
+ } catch {
65733
+ }
65717
65734
  if (Te) {
65718
65735
  let Pe = !1;
65719
65736
  try {
@@ -65722,7 +65739,7 @@ hiprint$1.register = async function(Ie = {}) {
65722
65739
  const Ue = String(De.aud), He = typeof window < "u" && window.location && window.location.host ? window.location.host : "";
65723
65740
  Ue !== "*" && He && Ue && Ue !== He && (Pe = !1);
65724
65741
  }
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));
65742
+ Pe && De.k && String(De.k) === REQUIRED_AUTH_KEY && (hiprint$1._authKey = String(De.k));
65726
65743
  } catch {
65727
65744
  }
65728
65745
  }
@@ -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 {