Browse Source

[优化] 生成token多传入用户id

threedate
邓平艺 4 years ago
parent
commit
c9a542dabd
  1. 2
      pages/center/invite.vue
  2. 19
      pages/goodsDetail/index.vue

2
pages/center/invite.vue

@ -77,7 +77,7 @@
}, },
getWxCode() { getWxCode() {
let userInfo = uni.getStorageSync('userinfo') || {}; let userInfo = uni.getStorageSync('userinfo') || {};
const token = this.$shared.createToken();
const token = this.$shared.createToken({user_id: userInfo.id});
let options = { let options = {
route: 'home', route: 'home',
pt: 2, pt: 2,

19
pages/goodsDetail/index.vue

@ -142,7 +142,8 @@
backgroundImg: '', backgroundImg: '',
goodShare: '', goodShare: '',
s_id: '', s_id: '',
isShowButtonCount: 0
isShowButtonCount: 0,
userInfo: {}
} }
}, },
computed: { computed: {
@ -155,7 +156,8 @@
onLoad(options) { onLoad(options) {
this.goods_id = options.id; this.goods_id = options.id;
this.pt = options.pt || 1; 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.getGoodsDetail();
this.getWxCode() this.getWxCode()
this.getBackground() this.getBackground()
@ -220,13 +222,15 @@
}) })
}, },
getWxCode() { 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 = { let options = {
route: 'goods', route: 'goods',
pt: 2, pt: 2,
id: this.goods_id, id: this.goods_id,
share_id: userInfo.id,
share_id: this.userInfo.id,
scene_code: this.$scene.V2_GOODS_SHAREPOSTER scene_code: this.$scene.V2_GOODS_SHAREPOSTER
} }
this.generateKooken(token, options); // token this.generateKooken(token, options); // token
@ -514,7 +518,10 @@
} }
}, },
onShareAppMessage() { 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 goods = this.goods_detail;
let options = { let options = {
id: goods.id, id: goods.id,

Loading…
Cancel
Save