Browse Source

正式代码发布

RaoMeng 6 years ago
parent
commit
6be11268aa

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

@@ -199,17 +199,17 @@ class AccountBind extends Component {
         fetchPost(API.BIND_OPENID, {
             userPhone: phone,
             code: code,
-            openid: this.props.userInfo.parent ? this.props.userInfo.parent.openid : this.props.userInfo.teacher.openid,
+            openid: this.props.userInfo.userOpenid,
         }).then(response => {
             Toast.hide()
             if (mType == 'parents') {
                 switchUser({
                     role: 1,
-                })
+                })()
             } else if (mType == 'teacher') {
                 switchUser({
                     role: 2,
-                })
+                })()
             }
 
             if (response && response.data) {
@@ -233,11 +233,11 @@ class AccountBind extends Component {
                             teacherBirthday: getStrValue(teacherDOS, 'teacherBirthday'),
                             teacherSex: getStrValue(teacherDOS, 'teacherSex'),//1:男,2:女
                         }
-                    })
+                    })()
                 } else {
                     switchUser({
                         teacher: ''
-                    })
+                    })()
                 }
 
                 if (response.data.parentsDOS) {
@@ -258,11 +258,11 @@ class AccountBind extends Component {
                             parentsPhoto: getStrValue(parentsDOS, 'parentsPhoto'),
                             parentsAddress: getStrValue(parentsDOS, 'parentsAddress'),
                         }
-                    })
+                    })()
                 } else {
                     switchUser({
                         parent: ''
-                    })
+                    })()
                 }
             }
             this.props.history.push('/homePage')

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

@@ -78,6 +78,9 @@ export default class BindMenu extends Component {
             openid: this.openid,
             schoolId: 1
         }).then(response => {
+            switchUser({
+                userOpenid: this.openid,
+            })()
             if (response.data) {
                 if (!isObjEmpty(response.data.teacherDOS)) {
                     const teacherDOS = response.data.teacherDOS[0]
@@ -135,9 +138,6 @@ export default class BindMenu extends Component {
                     bindStatus: 2
                 })
             } else {
-                switchUser({
-                    userOpenid: this.openid,
-                })()
                 this.setState({
                     bindStatus: 1
                 })

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

@@ -54,6 +54,7 @@ const initListState = {
     userAvatar: '',
     userSex: 0,*/
 
+    userOpenid: '',
     userRole: 0,
     teacher: '',
     parent: '',