Browse Source

微信头像上传后台

RaoMeng 6 years ago
parent
commit
6f05db4852

+ 2 - 1
frontend/wechat-web/src/configs/router.config.js

@@ -136,7 +136,7 @@ export default class RouteConfig extends Component {
                     <Route path='/leavedetail/:role/:lvId' component={LeaveDetail}/> {/*学生请假详情*/}
                     <Route path="/changephonenumber" component={ChangePhoneNumber}/> {/*更换手机号码*/}
                     <Route path="/scorenotification/:stuId?" component={ScoreNotification}/> {/*成绩通知*/}
-                    <Route path="/accessnoticedetail/:stuId/:anId?" component={AccessNoticeDetail}/>     {/*出入校通知详情*/}
+                    <Route path="/accessnoticedetail/:stuId/:anId?" component={AccessNoticeDetail}/> {/*出入校通知详情*/}
                     {/*<Route path="/accessnoticedetail" component={AccessNoticeDetail}/> /!*出入校通知详情*!/*/}
                     <Route path='/leaveAddC' component={LeaveAddCPage}/>{/*老师请假*/}
                     <Route path='/leaveAdd' component={LeaveAddPage}/> {/*学生请假*/}
@@ -149,6 +149,7 @@ export default class RouteConfig extends Component {
                     <Route path={"/TestImagesViewer"} component={TestImagesViewer}/>
                     <Route path={'/picturesWall'} component={PicturesWallItem}/>
                     <Route path='/leaveApproval' component={LeaveApprovalPage}/>
+
                 </div>
             </Router>
         );

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

@@ -199,6 +199,7 @@ class AccountBind extends Component {
             userPhone: phone,
             code: code,
             openid: this.props.userInfo.userOpenid,
+            headimgurl: this.props.userInfo.userAvatar,
         }).then(response => {
             Toast.hide()
             if (mType == 'parents') {

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

@@ -44,10 +44,9 @@ class BindMenu extends Component {
                 this.setState({
                     errorMsg: ''
                 })
-                window.location.href =
-                    'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
+                window.location.replace('https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
                     this.paramId + '&redirect_uri=https%3a%2f%2fschool-api.ubtob.com%2fapi%2fschool%2fwxSchool%2fuser%2fuserLogin&response_type=code&scope=snsapi_userinfo&state=' +
-                    this.paramId + '&connect_redirect=1#wechat_redirect'
+                    this.paramId + '&connect_redirect=1#wechat_redirect')
             }
 
         } else if (this.paramType === 'open') {
@@ -82,7 +81,8 @@ class BindMenu extends Component {
     obtainBindStatus = () => {
         fetchGet(API.USER_ISBINDING, {
             openid: this.openid,
-            schoolId: 1
+            schoolId: 1,//学校id暂时写死,后续需要添加选择学校的步骤
+            headimgurl: decodeURIComponent(this.wxAvatar),
         }).then(response => {
             switchUser({
                 userOpenid: this.openid,