|
@@ -23,7 +23,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...weixin(['jsAuth']),
|
|
...weixin(['jsAuth']),
|
|
async init() {
|
|
async init() {
|
|
- console.log(this.$router);
|
|
|
|
|
|
+ // 处理参数
|
|
const { path, query } = this.$route;
|
|
const { path, query } = this.$route;
|
|
const { openid, ...others } = query;
|
|
const { openid, ...others } = query;
|
|
let uri = `${path}`;
|
|
let uri = `${path}`;
|
|
@@ -34,6 +34,8 @@ export default {
|
|
}
|
|
}
|
|
// const url = encodeURIComponent(`${this.host}${process.env.VUE_APP_ROUTER}${uri}`);
|
|
// const url = encodeURIComponent(`${this.host}${process.env.VUE_APP_ROUTER}${uri}`);
|
|
const url = encodeURIComponent(location.href.split('#')[0]);
|
|
const url = encodeURIComponent(location.href.split('#')[0]);
|
|
|
|
+ console.log(url);
|
|
|
|
+ console.log(encodeURIComponent(`${this.host}${process.env.VUE_APP_ROUTER}${uri}`));
|
|
const res = await this.jsAuth({ url });
|
|
const res = await this.jsAuth({ url });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
const { data } = res;
|
|
const { data } = res;
|
|
@@ -58,11 +60,12 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
toShare() {
|
|
toShare() {
|
|
|
|
+ const url = encodeURIComponent(location.href.split('#')[0]);
|
|
this.wx.updateAppMessageShareData({
|
|
this.wx.updateAppMessageShareData({
|
|
title: '测试分享',
|
|
title: '测试分享',
|
|
desc: '测试',
|
|
desc: '测试',
|
|
// imgUrl:''
|
|
// imgUrl:''
|
|
- link: 'http://free.waityou24.cn/',
|
|
|
|
|
|
+ link: url,
|
|
success: res => {
|
|
success: res => {
|
|
console.log('in function:share success');
|
|
console.log('in function:share success');
|
|
console.log(res);
|
|
console.log(res);
|