Skip to content

Commit 62d875c

Browse files
committed
release: v1.0.5
1 parent d728d88 commit 62d875c

6 files changed

+32
-23
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [1.0.5](https://github.com/jizai1125/gdt-qrcode/compare/v1.0.4...v1.0.5) (2024-05-20)
2+
3+
4+
### Bug Fixes
5+
6+
* messageHandler this bind ([7ec2cc8](https://github.com/jizai1125/gdt-qrcode/commit/7ec2cc87faceb1c50447d304292afdfa91cb3d4a))
7+
8+
9+
110
## [1.0.4](https://github.com/jizai1125/gdt-qrcode/compare/v1.0.3...v1.0.4) (2024-05-19)
211

312

dist/gdt-qrcode.es.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gdt-qrcode.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var L = Object.defineProperty;
22
var S = (o, e, t) => e in o ? L(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3-
var a = (o, e, t) => (S(o, typeof e != "symbol" ? e + "" : e, t), t);
3+
var d = (o, e, t) => (S(o, typeof e != "symbol" ? e + "" : e, t), t);
44
import { defineComponent as _, mergeDefaults as b, ref as p, watch as f, onMounted as v, onUnmounted as U, openBlock as k, createElementBlock as M } from "vue";
55
function O(o, e, t = !0) {
66
const i = new URL(o);
@@ -24,11 +24,15 @@ const y = "https://login-pro.ding.zj.gov.cn", u = {
2424
};
2525
class E {
2626
constructor(e, t) {
27-
a(this, "dom");
28-
a(this, "domClassName", "gdt-qrcode-wrapper");
29-
a(this, "options", u);
30-
a(this, "iframe");
31-
a(this, "url");
27+
d(this, "dom");
28+
d(this, "domClassName", "gdt-qrcode-wrapper");
29+
d(this, "options", u);
30+
d(this, "iframe");
31+
d(this, "url");
32+
d(this, "messageHandler", (e) => {
33+
var t, i;
34+
this.options && e.origin.match(this.options.domain) && ((i = (t = this.options).onScanned) == null || i.call(t, e.data.code, e.data));
35+
});
3236
this.options = {
3337
...u,
3438
...t
@@ -69,15 +73,11 @@ class E {
6973
redirect_uri: t
7074
});
7175
}
72-
offMessage() {
73-
window.removeEventListener("message", this.messageHandler);
74-
}
7576
registerMessage() {
7677
this.offMessage(), window.addEventListener("message", this.messageHandler);
7778
}
78-
messageHandler(e) {
79-
var t, i;
80-
this.options && e.origin.match(this.options.domain) && ((i = (t = this.options).onScanned) == null || i.call(t, e.data.code, e.data));
79+
offMessage() {
80+
window.removeEventListener("message", this.messageHandler);
8181
}
8282
}
8383
const x = /* @__PURE__ */ _({
@@ -102,11 +102,11 @@ const x = /* @__PURE__ */ _({
102102
}
103103
f(
104104
[() => t.url, () => t.clientId, () => t.redirectUri],
105-
([s, d, c]) => {
105+
([s, a, c]) => {
106106
var l;
107107
(l = n.value) == null || l.update({
108108
url: s,
109-
clientId: d,
109+
clientId: a,
110110
redirectUri: c
111111
}), h();
112112
}
@@ -118,19 +118,19 @@ const x = /* @__PURE__ */ _({
118118
() => t.showLogo,
119119
() => t.blockLine
120120
],
121-
([s, d, c, l, C]) => {
121+
([s, a, c, l, C]) => {
122122
var m;
123123
(m = n.value) == null || m.updateStyle({
124124
width: s,
125-
height: d,
125+
height: a,
126126
onlyShowCode: c,
127127
showLogo: l,
128128
blockLine: C
129129
});
130130
}
131131
);
132-
function w(s, d) {
133-
i("scanned", s, d);
132+
function w(s, a) {
133+
i("scanned", s, a);
134134
}
135135
return v(() => {
136136
n.value = new E(r.value, {
@@ -140,7 +140,7 @@ const x = /* @__PURE__ */ _({
140140
}), U(() => {
141141
var s;
142142
(s = n.value) == null || s.destroy();
143-
}), (s, d) => (k(), M("div", {
143+
}), (s, a) => (k(), M("div", {
144144
ref_key: "qrcodeContainerRef",
145145
ref: r
146146
}, null, 512));

dist/gdt-qrcode.umd.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export declare class GdtQRCode {
1414
updateStyle(options?: QRCodeStyleOptions): void;
1515
destroy(): void;
1616
private formatUrl;
17-
private offMessage;
1817
private registerMessage;
18+
private offMessage;
1919
private messageHandler;
2020
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gdt-qrcode",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "政务钉钉扫码登录",
55
"keywords": [
66
"dingtalk",

0 commit comments

Comments
 (0)