Commit 5d02e14e by MichaelJier

Merge branch 'dev' into test

parents 38f35110 cd91a926
......@@ -24,7 +24,7 @@ export default {
return {
title: this.channelInfo.shareTitle || this.channelInfo.channelName,
desc: this.channelInfo.shareSubTitle || window.location.href,
link: window.location.href,
link: this.updateQueryStringParameter(window.location.href, 'refererId', this.userInfo.id || 0),
imgUrl: this.channelInfo.shareImgUrl || this.channelInfo.mpsBackgroundUrl,
success() {
self.shareSuccessBack();
......@@ -45,6 +45,19 @@ export default {
}
},
methods: {
updateQueryStringParameter(uri, key, value) {
if (!value) {
return uri;
}
const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
const separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
}
else {
return uri + separator + key + "=" + value;
}
},
_toggleShare(bol) {
if (UserAgent.isWx()) {
this.isShow = bol;
......
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