优化wxSDK方法;

This commit is contained in:
yuantao
2025-08-13 20:23:06 +08:00
parent dc2d0ccc41
commit 0ab444772d
3 changed files with 5 additions and 65 deletions

3
.gitignore vendored
View File

@@ -3,4 +3,5 @@ node_modules
_notes/
src/_notes
.vscode/
dist
dist
*.min.js

View File

@@ -2961,12 +2961,12 @@
const timeLine = {
title: isObj(title) ? title[0] : title,
link: isObj(shareLinks) ? shareLinks[0] : shareLinks,
link: isObj(shareLinks) ? shareLinks[0] : w.location.href.split(`#`)[0],
imgUrl: isObj(shareIcon) ? shareIcon[0] : shareIcon,
},
friend = {
title: isObj(title) ? title[1] : title,
link: isObj(shareLinks) ? shareLinks[1] : shareLinks,
link: isObj(shareLinks) ? shareLinks[1] : w.location.href.split(`#`)[0],
imgUrl: isObj(shareIcon) ? shareIcon[1] : shareIcon,
desc,
}
@@ -2978,13 +2978,11 @@
new Promise(next => {
if (wx.updateTimelineShareData) {
const { title, link, imgUrl } = timeLine
console.log('timeLine', timeLine)
const { success, error } = callback
wx.updateTimelineShareData({ title, link, imgUrl, success, error })
}
if (wx.updateAppMessageShareData) {
const { title, link, imgUrl, desc } = friend
console.log('friend', friend)
const { success, error } = callback
wx.updateAppMessageShareData({ title, desc, link, imgUrl, success, error })
}
@@ -2998,7 +2996,7 @@
}
scriptTag.onload = () => {
this.ajax({ url: `${apiUrl}${encodeURIComponent(w.location.href.split(`#`)[0])}` }).then(success)
this.ajax({ url: `${apiUrl}${w.location.href.split(`#`)[0]}` }).then(success)
}
return this

59
Pandora.min.js vendored

File diff suppressed because one or more lines are too long