| xqd
@@ -65,7 +65,8 @@ export default {
|
|
|
4: 'rank'
|
|
|
},
|
|
|
homeColumn: [],
|
|
|
- parent_id: 0
|
|
|
+ parent_id: 0,
|
|
|
+ scene_code: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
| xqd
@@ -79,8 +80,9 @@ export default {
|
|
|
onLoad(options) {
|
|
|
console.log('-->index data', options)
|
|
|
this.isLogin && this.getHomeColumn()
|
|
|
+ this.scene_code = typeof options.user_id !== 'undefined' ? options.scene : ''
|
|
|
this.parent_id = typeof options.user_id !== 'undefined' ? options.user_id : 0
|
|
|
- if (this.parent_id && !this.userInfo.parent_id) {
|
|
|
+ if ((this.parent_id || this.scene_code) && !this.userInfo.parent_id) {
|
|
|
this.isLogin && this.bindParent()
|
|
|
}
|
|
|
},
|
| xqd
@@ -106,7 +108,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
bindParent() {
|
|
|
- this.$api.user.bind(this.parent_id).then(res => {
|
|
|
+ this.$api.user.bind(this.parent_id ? this.parent_id : this.scene_code).then(res => {
|
|
|
console.log('-->bind success')
|
|
|
this.$store.dispatch('user/info', res.data)
|
|
|
})
|