|
@@ -89,7 +89,7 @@ import wepy from '@wepy/core';
|
|
|
import { mapState } from '@wepy/x';
|
|
|
import store from '@/store';
|
|
|
import config from '@/config';
|
|
|
-import { setAvatar, setUserInfoByAuth } from '@/service/user';
|
|
|
+import { setAvatar, checkLoginNew, setUserInfoByAuth } from '@/service/user';
|
|
|
import { getHttpPhoneNumber } from '@/api/user';
|
|
|
let defaultAvatarUrl =
|
|
|
config.h5StaticPath + '/page-bind-tenant/default_avatar.svg';
|
|
@@ -110,7 +110,18 @@ wepy.page({
|
|
|
this.canIUseGetUserProfile = true;
|
|
|
}
|
|
|
},
|
|
|
- onShow() {},
|
|
|
+ onShow() {
|
|
|
+ // 过期重定向处理
|
|
|
+ // checkLoginNew().then(res => {
|
|
|
+ // if (res.data && res.data.isActivated == 1) {
|
|
|
+ // this.goHome();
|
|
|
+ // } else {
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: '/pages/index'
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 绑定租户
|
|
|
bindTenant() {},
|
|
@@ -138,6 +149,8 @@ wepy.page({
|
|
|
phonenumberAuth(e) {
|
|
|
let detail = e.$wx.detail;
|
|
|
let code = detail.code;
|
|
|
+ // store.commit('setUserPhone', 13810794283);
|
|
|
+ // this.goBindTenant();
|
|
|
this.getHttpPhoneNumber(code);
|
|
|
},
|
|
|
// code 换取手机号
|
|
@@ -145,8 +158,10 @@ wepy.page({
|
|
|
getHttpPhoneNumber(code).then(res => {
|
|
|
let data = res.data || {};
|
|
|
let phoneNumber = data.purePhoneNumber;
|
|
|
- store.commit('setUserPhone', phoneNumber);
|
|
|
- this.goBindTenant();
|
|
|
+ if (phoneNumber) {
|
|
|
+ store.commit('setUserPhone', phoneNumber);
|
|
|
+ this.goBindTenant();
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
goBindTenant() {
|