qingyiay
2023-03-22 8e095c1fd6164fafc7d5cfd144528a0d67afef7c
pages/login/userPassword.vue
@@ -43,7 +43,7 @@
   },
   data() {
      return {
         username: 'appuser',// 客户
         username: 'appuser', // 客户
         // username: '18805080506',// 王楠(司机)
         password: '123456',
         remember: true,
@@ -84,20 +84,22 @@
                     setRefreshToken(res.refresh_token);
                     setUsernameKey(res.username);
                     //查询用户详细信息并储存
                     this.$reqGet('getUserEntity').then(res => {
                        this.$u.toast('恭喜您,登录成功!');
                        this.setUserTabbar(res.data.type);
                        uni.setStorageSync('roleType', res.data.type);
                        setCustomerId(res.data.customerid);
                        uni.hideLoading();
                        //跳转页面
                        this.$nextTick(() => {
                           redirectHome();
                     this.$reqGet('getUserEntity')
                        .then(res => {
                           this.$u.toast('恭喜您,登录成功!');
                           this.setUserTabbar(res.data.type);
                           uni.setStorageSync('roleType', res.data.type);
                           setCustomerId(res.data.customerid);
                           uni.hideLoading();
                           //跳转页面
                           this.$nextTick(() => {
                              redirectHome();
                           });
                        })
                        .catch(err => {
                           this.$u.toast('登录异常!');
                           console.log(err);
                        });
                     }).catch(err=>{
                        this.$u.toast('登录异常!');
                        console.log(err);
                     });
                  } else {
                     uni.hideLoading();
                     this.$u.toast(res.msg);