Commit c1d7cae2 by fengfan

updateTimelineShareData TITLE set

parent 3ce50512
......@@ -103,7 +103,7 @@ function _init_wx_jssdk(){
})
wx.updateTimelineShareData({
title: FRONT_TITLE, // 分享标题
title: getUserInfoByLocalStorage()?`${getUserInfoByLocalStorage()}的2020幸运打卡地:丹寨`:FRONT_TITLE, // 分享标题
link: FRONT_URL, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: shareImg(), // 分享图标
success: function () {
......
......@@ -129,11 +129,16 @@ const getUserInfo = async(storage='local')=>{
}
}else{
const userInfo = await $get('/weixin/userinfo').then(res=>res.data).catch(err=>{ throw err })
localStorage.setItem('userInfo',JSON.stringify(userInfo))
return {...userInfo}
}
}
const getUserInfoByLocalStorage = function () {
return JSON.parse(localStorage.getItem('userInfo'))?JSON.parse(localStorage.getItem('userInfo')).nickname:false
}
function setWxConfig (config) {
wx.config(config)
}
......
......@@ -433,7 +433,7 @@ var vueInstance = new Vue({
title: FRONT_TITLE, // 分享标题
desc: FRONT_DESC, // 分享描述
link: FRONT_URL, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: shareImg(), // 分享图标currentInfo.small_image||
imgUrl: shareImg(), // 分享图标currentInfo.small_image
success: function () {
// 设置成功
}
......
......@@ -353,7 +353,7 @@ function _init_wx_jssdk(){
})
wx.updateTimelineShareData({
title: FRONT_TITLE, // 分享标题
title: getUserInfoByLocalStorage()?`${getUserInfoByLocalStorage()}的2020幸运打卡地:丹寨`:FRONT_TITLE, // 分享标题
link: FRONT_URL, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl:shareImg(), // 分享图标
success: function () {
......
......@@ -548,7 +548,7 @@ var vueInstance = new Vue({
})
wx.updateTimelineShareData({
title: shareTitle, // 分享标题
title: getUserInfoByLocalStorage()?`${getUserInfoByLocalStorage()}的2020幸运打卡地:丹寨`:FRONT_TITLE, // 分享标题
link: FRONT_URL, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: shareImg(), // 分享图标
success: function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment