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() {
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,

19
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,

Loading…
Cancel
Save