From c9a542dabd1c122abda471b5466efd4d36efaadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Sat, 17 Jul 2021 12:22:14 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E7=94=9F=E6=88=90token?= =?UTF-8?q?=E5=A4=9A=E4=BC=A0=E5=85=A5=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/center/invite.vue | 2 +- pages/goodsDetail/index.vue | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pages/center/invite.vue b/pages/center/invite.vue index 7a57e06..09d784d 100644 --- a/pages/center/invite.vue +++ b/pages/center/invite.vue @@ -77,7 +77,7 @@ }, getWxCode() { let userInfo = uni.getStorageSync('userinfo') || {}; - const token = this.$shared.createToken(); + const token = this.$shared.createToken({user_id: userInfo.id}); let options = { route: 'home', pt: 2, diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue index 39c1275..2941a12 100644 --- a/pages/goodsDetail/index.vue +++ b/pages/goodsDetail/index.vue @@ -142,7 +142,8 @@ backgroundImg: '', goodShare: '', s_id: '', - isShowButtonCount: 0 + isShowButtonCount: 0, + userInfo: {} } }, computed: { @@ -155,7 +156,8 @@ onLoad(options) { this.goods_id = options.id; this.pt = options.pt || 1; - this.s_id = options.share_id || '' + this.s_id = options.share_id || ''; + this.userInfo = uni.getStorageSync('userinfo') || {}; this.getGoodsDetail(); this.getWxCode() this.getBackground() @@ -220,13 +222,15 @@ }) }, getWxCode() { - let userInfo = uni.getStorageSync('userinfo') || {}; - const token = this.$shared.createToken(); + const token = this.$shared.createToken({ + user_id: this.userInfo.id, + goods_id: this.goods_id + }); let options = { route: 'goods', pt: 2, id: this.goods_id, - share_id: userInfo.id, + share_id: this.userInfo.id, scene_code: this.$scene.V2_GOODS_SHAREPOSTER } this.generateKooken(token, options); // 谁分享了就生成一个token @@ -514,7 +518,10 @@ } }, onShareAppMessage() { - const token = this.$shared.createToken(); + const token = this.$shared.createToken({ + user_id: this.userInfo.id, + goods_id: this.goods_id + }); let goods = this.goods_detail; let options = { id: goods.id,