FANGLH 6 anos atrás
pai
commit
6c0ee57263

+ 3 - 0
frontend/wechat-web/src/modules/accountBind/AccountBind.jsx

@@ -213,6 +213,9 @@ class AccountBind extends Component {
             }
 
             if (response && response.data) {
+                switchUser({
+                    token:''
+                })()
                 if (response.data.teacherDOS) {
                     const teacherDOS = response.data.teacherDOS[0]
 

+ 1 - 0
frontend/wechat-web/src/modules/accountBind/BindMenu.jsx

@@ -90,6 +90,7 @@ class BindMenu extends Component {
         }).then(response => {
             switchUser({
                 userOpenid: this.openid,
+                token:''
             })()
             if (response.data) {
                 if (!isObjEmpty(response.data.teacherDOS)) {

+ 19 - 0
frontend/wechat-web/src/modules/home/HomePage.jsx

@@ -271,17 +271,36 @@ class HomePage extends Component {
         operation([
             {
                 text: '家长', onPress: () => {
+                //TODO 拿token
+                fetchGet(API.leaveDetail, {}).then((response) => {
+                    if (response.success && !isObjEmpty(response.data)) {
+
+                    }
+                }).catch((error) => {
+                    console.log("error:", JSON.stringify(error));
+                })
+
                 if (this.props.userInfo.userRole === 2) {
                     Toast.loading('身份切换中...', 0)
                     setTimeout(() => {
                         Toast.success('切换成功!', 1)
                         switchCurrentUser(1)()
                     }, 400)
+                } else if (this.props.userInfo.userRole === 1) {
+                    Toast.loading('身份切换中...', 0)
+                    setTimeout(() => {
+                        Toast.success('切换成功!', 1)
+                        switchCurrentUser(2)()
+                    }, 400)
                 }
+                switchUser({
+                    token: ''
+                })()
             }
             },
             {
                 text: '教师', onPress: () => {
+
                 if (this.props.userInfo.userRole === 1) {
                     Toast.loading('身份切换中...', 0)
                     setTimeout(() => {

+ 3 - 1
frontend/wechat-web/src/redux/reducers/redUserInfo.js

@@ -52,7 +52,8 @@ const initListState = {
     userRoles: [],
     accessToken: '17_2JV4JY47Ht5gTNCVHPQ3ya6ov9GPmtz_0JACss95_KdxnCVOWhrkmcLqBb27KmnEsYtLaWHxAT_bV_K44hRKD9A1yFib9IFYSkAdrVGtY-A',
     userAvatar: '',
-    userSex: 0,*/
+    userSex: 0,
+    token:''*/
 
     appId: '',
     userOpenid: '',
@@ -63,6 +64,7 @@ const initListState = {
     user: {
         student: {}
     },
+    token:''
 }
 
 const redUserInfo = (state = initListState, action) => {