litian
2024-03-29 4b5f1f7ed3460df9465e5071a59b8105cbc9146e
pages/personalCenter/index.js
@@ -135,6 +135,14 @@
      barHeight: systInfo.statusBarHeight,
      navBarHeight: navBarHeight,
    });
  },
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        active: 4
      })
    }
    // 检查登录状态
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
@@ -151,13 +159,6 @@
        currAuthStep: 1,
      });
      this.getUserInfo()
    }
  },
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        active: 4
      })
    }
  },
  /**
@@ -197,8 +198,8 @@
        if (teacherRole && teacherInfos) {
          defaultUser = {
            ...teacherInfos,
            nickName: teacherInfos.name,
            icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '',
            nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name,
            icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon,
            userId: res.userId,
            role: 'Teacher',
            roleId: teacherRole.role.id,
@@ -211,8 +212,8 @@
        } else if (WeChatInfo) {
          defaultUser = {
            ...WeChatInfo,
            nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name,
            icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon,
            nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name,
            icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon,
            userId: res.userId,
            userType: type,
            role: 'Student',