zmp-sdk 2.15.0-rc.4 → 2.15.0-rc.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.
- package/dist/browser.min.js +7 -4
- package/dist/index.es.js +7 -4
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/browser.min.js
CHANGED
|
@@ -36589,7 +36589,7 @@
|
|
|
36589
36589
|
}
|
|
36590
36590
|
};
|
|
36591
36591
|
|
|
36592
|
-
var version = "2.15.0-rc.
|
|
36592
|
+
var version = "2.15.0-rc.5";
|
|
36593
36593
|
|
|
36594
36594
|
class Basics {
|
|
36595
36595
|
/**
|
|
@@ -38464,6 +38464,7 @@
|
|
|
38464
38464
|
case 'zmp':
|
|
38465
38465
|
const currentUrl = new URL(location.href);
|
|
38466
38466
|
const params = new URLSearchParams();
|
|
38467
|
+
const accessToken = yield this.getAccessToken();
|
|
38467
38468
|
const description = {
|
|
38468
38469
|
vi: '',
|
|
38469
38470
|
en: ''
|
|
@@ -38484,12 +38485,13 @@
|
|
|
38484
38485
|
params.append('description', description.vi || description.en);
|
|
38485
38486
|
params.append('thumbnail', object.data.thumbnail);
|
|
38486
38487
|
params.append('url', validUrl.href);
|
|
38487
|
-
|
|
38488
|
+
params.append('accessToken', accessToken || '');
|
|
38489
|
+
const postConfig = {
|
|
38488
38490
|
headers: {
|
|
38489
38491
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
38490
38492
|
}
|
|
38491
38493
|
};
|
|
38492
|
-
const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params,
|
|
38494
|
+
const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params, postConfig);
|
|
38493
38495
|
const resData = res.data;
|
|
38494
38496
|
if (!resData || resData.err !== 0) {
|
|
38495
38497
|
throw apiResponse.error.cannotGetShareInfo();
|
|
@@ -38498,8 +38500,9 @@
|
|
|
38498
38500
|
const platform = checkPlatform();
|
|
38499
38501
|
if ((platform.isAndroid && zaloVersion % 100000 <= 593) ||
|
|
38500
38502
|
(platform.isIOS && zaloVersion <= 424)) {
|
|
38503
|
+
validUrl.search = `${validUrl.search}&zshareId=${resData.data.shareId}`;
|
|
38501
38504
|
reqData = {
|
|
38502
|
-
link:
|
|
38505
|
+
link: validUrl.href,
|
|
38503
38506
|
chatOnly: object.data.chatOnly ? 1 : 0
|
|
38504
38507
|
};
|
|
38505
38508
|
object.type = 'link';
|
package/dist/index.es.js
CHANGED
|
@@ -36586,7 +36586,7 @@ const apiResponse = {
|
|
|
36586
36586
|
}
|
|
36587
36587
|
};
|
|
36588
36588
|
|
|
36589
|
-
var version = "2.15.0-rc.
|
|
36589
|
+
var version = "2.15.0-rc.5";
|
|
36590
36590
|
|
|
36591
36591
|
class Basics {
|
|
36592
36592
|
/**
|
|
@@ -38461,6 +38461,7 @@ class Zalo {
|
|
|
38461
38461
|
case 'zmp':
|
|
38462
38462
|
const currentUrl = new URL(location.href);
|
|
38463
38463
|
const params = new URLSearchParams();
|
|
38464
|
+
const accessToken = yield this.getAccessToken();
|
|
38464
38465
|
const description = {
|
|
38465
38466
|
vi: '',
|
|
38466
38467
|
en: ''
|
|
@@ -38481,12 +38482,13 @@ class Zalo {
|
|
|
38481
38482
|
params.append('description', description.vi || description.en);
|
|
38482
38483
|
params.append('thumbnail', object.data.thumbnail);
|
|
38483
38484
|
params.append('url', validUrl.href);
|
|
38484
|
-
|
|
38485
|
+
params.append('accessToken', accessToken || '');
|
|
38486
|
+
const postConfig = {
|
|
38485
38487
|
headers: {
|
|
38486
38488
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
38487
38489
|
}
|
|
38488
38490
|
};
|
|
38489
|
-
const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params,
|
|
38491
|
+
const res = yield axios.post('https://h5.zalo.me/openapi/create-sharelink', params, postConfig);
|
|
38490
38492
|
const resData = res.data;
|
|
38491
38493
|
if (!resData || resData.err !== 0) {
|
|
38492
38494
|
throw apiResponse.error.cannotGetShareInfo();
|
|
@@ -38495,8 +38497,9 @@ class Zalo {
|
|
|
38495
38497
|
const platform = checkPlatform();
|
|
38496
38498
|
if ((platform.isAndroid && zaloVersion % 100000 <= 593) ||
|
|
38497
38499
|
(platform.isIOS && zaloVersion <= 424)) {
|
|
38500
|
+
validUrl.search = `${validUrl.search}&zshareId=${resData.data.shareId}`;
|
|
38498
38501
|
reqData = {
|
|
38499
|
-
link:
|
|
38502
|
+
link: validUrl.href,
|
|
38500
38503
|
chatOnly: object.data.chatOnly ? 1 : 0
|
|
38501
38504
|
};
|
|
38502
38505
|
object.type = 'link';
|