main
xy 2 years ago
parent 421e23e798
commit d5d4f9cde7

@ -8,52 +8,54 @@
let temp = decodeURIComponent((new RegExp('[?|&]' + 'code' + '=' + '([^&;]+?)(&|#|;|$)').exec(link) ||
[, ''])[1].replace(/\+/g, '%20')) || null
let lifeData = uni.getStorageSync('lifeData')
if (!lifeData.vuex_token || !lifeData.vuex_userId) {
if (!lifeData.vuex_token || !lifeData.vuex_user) {
this.$u.api.login({
code: temp
}).then(res => {
this.$u.vuex('vuex_token', res.token)
this.$u.api.user().then(res => {
this.$u.vuex('vuex_user', res)
})
this.$u.vuex('vuex_token', res.token)
let url = location.href.split('#')[0]
this.$u.api.share({
url
}).then(res => {
jwx.config({
debug: false, // , api alert pc log pc
appId: res.appId,
jsApiList: res.jsApiList,
nonceStr: res.nonceStr,
signature: res.signature,
timestamp: res.timestamp,
})
jwx.ready(() => {
jwx.updateAppMessageShareData({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'http://h5.ali251.langye.net/res/share-img.jpeg', //
});
jwx.updateTimelineShareData({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'http://h5.ali251.langye.net/res/share-img.jpeg', //
});
jwx.onMenuShareAppMessage({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'http://h5.ali251.langye.net/res/share-img.jpeg', //
});
jwx.onMenuShareTimeline({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'http://h5.ali251.langye.net/res/share-img.jpeg', //
});
let url = location.href.split('#')[0]
this.$u.api.share({
url
}).then(res => {
jwx.config({
debug: false, // , api alert pc log pc
appId: res.appId,
jsApiList: res.jsApiList,
nonceStr: res.nonceStr,
signature: res.signature,
timestamp: res.timestamp,
})
jwx.ready(() => {
jwx.updateAppMessageShareData({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.updateTimelineShareData({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.onMenuShareAppMessage({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
jwx.onMenuShareTimeline({
title: '我是党史记录人-红色少年行 未成年人研学', //
desc: '我是党史记录人-红色少年行 未成年人研学',
link: url, // ,JS
imgUrl: 'https://vr.langye.net/res/share-dangshi-img.jpg', //
});
})
})
})
})

@ -38,10 +38,6 @@ const install = (Vue, vm) => {
console.log('res-http', res)
if (res.statusCode === 200) {
if (res.data.hasOwnProperty("errcode")) {
uni.showToast({
icon: "none",
title: res?.data?.errmsg
})
if (res.data?.errcode === 40001) {
setTimeout(() => {
@ -52,6 +48,10 @@ const install = (Vue, vm) => {
}
return false;
} else {
uni.showToast({
icon: "none",
title: res?.data?.errmsg
})
return res.data;
}
} else {

Loading…
Cancel
Save