|
|
@@ -260,6 +260,14 @@ export default {
|
|
|
} else {
|
|
|
Locale.use('zh-CN', zhCN);
|
|
|
}
|
|
|
+ let token = this.$route.query.token;
|
|
|
+ if (token) {
|
|
|
+ document.title = "返回茶付宝";
|
|
|
+ localStorage.setItem('account', this.$route.query.mobile);
|
|
|
+ localStorage.setItem('token__' + this.$route.query.mobile, token);
|
|
|
+ localStorage.setItem('website', 'app');
|
|
|
+ this.$store.commit('SETACCOUNTS', this.$route.query.mobile);
|
|
|
+ }
|
|
|
this.inviteCode = this.$route.query.inviteCode;
|
|
|
if (this.inviteCode) {
|
|
|
localStorage.setItem('inviteCode', this.inviteCode);
|
|
|
@@ -318,33 +326,61 @@ export default {
|
|
|
// sign: res,
|
|
|
};
|
|
|
//绑定上级 看信息
|
|
|
- homeApi.auth(data).then(res => {
|
|
|
- // console.log('走了这里11');
|
|
|
- //我是绑定上级
|
|
|
- if (res.code == 200) {
|
|
|
- if (res.data.parent_id != 0) {
|
|
|
- Notify({ type: 'success', message: this.$t('lang152') });
|
|
|
- this.bindShow = false;
|
|
|
- this.show = false;
|
|
|
- this.init();
|
|
|
- localStorage.setItem('userinfo', JSON.stringify(res.data));
|
|
|
- localStorage.setItem('token__' + account, res.data.token);
|
|
|
- localStorage.setItem('parentId', res.data.parent_id);
|
|
|
+ if (localStorage.getItem('website')) {
|
|
|
+ homeApi.chaBindParent({
|
|
|
+ mobile: this.account,
|
|
|
+ inviteCode: this.inviteCode,
|
|
|
+ }).then(res => {
|
|
|
+ // console.log('走了这里11');
|
|
|
+ //我是绑定上级
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data.parent_id != 0) {
|
|
|
+ Notify({ type: 'success', message: this.$t('lang152') });
|
|
|
+ this.bindShow = false;
|
|
|
+ this.show = false;
|
|
|
+ this.init();
|
|
|
+ localStorage.setItem('userinfo', JSON.stringify(res.data));
|
|
|
+ localStorage.setItem('token__' + this.account, res.data.token);
|
|
|
+ localStorage.setItem('parentId', res.data.parent_id);
|
|
|
+ } else {
|
|
|
+ this.show = true;
|
|
|
+ Notify({ type: 'danger', message: res.msg });
|
|
|
+ }
|
|
|
} else {
|
|
|
this.show = true;
|
|
|
Notify({ type: 'danger', message: res.msg });
|
|
|
}
|
|
|
- } else {
|
|
|
- this.show = true;
|
|
|
- Notify({ type: 'danger', message: res.msg });
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ homeApi.auth(data).then(res => {
|
|
|
+ // console.log('走了这里11');
|
|
|
+ //我是绑定上级
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data.parent_id != 0) {
|
|
|
+ Notify({ type: 'success', message: this.$t('lang152') });
|
|
|
+ this.bindShow = false;
|
|
|
+ this.show = false;
|
|
|
+ this.init();
|
|
|
+ localStorage.setItem('userinfo', JSON.stringify(res.data));
|
|
|
+ localStorage.setItem('token__' + this.account, res.data.token);
|
|
|
+ localStorage.setItem('parentId', res.data.parent_id);
|
|
|
+ } else {
|
|
|
+ this.show = true;
|
|
|
+ Notify({ type: 'danger', message: res.msg });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.show = true;
|
|
|
+ Notify({ type: 'danger', message: res.msg });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
changeBanner(index) {
|
|
|
this.$refs.swipeRef.swipeTo(index, { immediate: false });
|
|
|
},
|
|
|
getUserInfo() {
|
|
|
- homeApi.getUserInfo({ address: this.account, inviteCode: this.inviteCode }).then(res => {
|
|
|
+ // address: this.account, inviteCode: this.inviteCode
|
|
|
+ homeApi.getUserInfo({}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
localStorage.setItem('userinfo', JSON.stringify(res.data));
|
|
|
localStorage.setItem('parentId', res.data.parent_id);
|