소스 검색

作业详情id问题
文件上传url更改

RaoMeng 6 년 전
부모
커밋
7c828b03e5

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

@@ -138,7 +138,7 @@ export const API = {
     //出入校单次记录详情
 
     //更改手机号是获取验证码
-    SEND_CODEUPDATE:_baseURL +'/wxSchool/user/sendCodeUpdate',
+    SEND_CODEUPDATE: _baseURL + '/wxSchool/user/sendCodeUpdate',
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //获取用户是否绑定
@@ -163,7 +163,7 @@ export const API = {
     //获取学生班级列表
     GET_STU_CLASS_LIST: _baseURL + '/wxSchool/clazz/selectClazzByStu',
     //文件上传地址
-    UPLOAD_FILE: _baseURL + '/wxSchool/file/uploadFile',
+    UPLOAD_FILE: 'https://school-api.ubtob.com/api/file/upload',
     //新建相册
     NEW_CLASS_ALBUM: _baseURL + '/wxSchool/clazzAlbum/createAlbum',
     //修改相册

+ 22 - 11
frontend/wechat-web/src/modules/homework/AssignmentDetailPage.js

@@ -9,7 +9,7 @@ import '../../style/css/app-gloal.css'
 import {List, Input, Button} from 'antd';
 import {fetchPost, fetchGet} from '../../utils/fetchRequest';
 import {API, _baseURL} from '../../configs/api.config';
-import {getIntValue, getStrValue, isObjEmpty} from '../../utils/common';
+import {getIntValue, getSearchParams, getStrValue, isObjEmpty} from '../../utils/common';
 import ImagesViewer from "../../components/imagesVIewer/ImagesViewer";
 import {Toast} from 'antd-mobile'
 import {Avatar} from 'antd'
@@ -48,6 +48,17 @@ class AssignmentDetailPage extends React.Component {
     }
 
     componentDidMount() {
+        this.searchParams = getSearchParams(this.props.location.search)
+        this.stuId = this.props.userInfo.user.student.stuId
+        this.parentId = this.props.userInfo.user.userFunId
+        if (this.searchParams) {
+            if (this.searchParams.stuId) {
+                this.stuId = this.searchParams.stuId
+            }
+            if (this.searchParams.parentId) {
+                this.parentId = this.searchParams.parentId
+            }
+        }
         Toast.show('', 0)
         this.getHomeworkDetail()
     }
@@ -65,7 +76,7 @@ class AssignmentDetailPage extends React.Component {
     getHomeworkDetail = () => {
         fetchPost(API.HOMEWORK_DETAIL, {
             taskId: this.state.id,
-            stuId: this.props.userInfo.user.student.stuId
+            stuId: this.stuId
         }).then((response) => {
             Toast.hide()
             if (response && response.data) {
@@ -142,8 +153,8 @@ class AssignmentDetailPage extends React.Component {
             taskId: this.state.id,
             replyTitle: '这是作业的回复',
             replyContext: this.state.messageContent,
-            parentId: this.props.userInfo.user.userFunId,
-            stuId: this.props.userInfo.user.student.stuId
+            parentId: this.parentId,
+            stuId: this.stuId
         }
         fetchPost(API.HOMEWORK_REPLY, {
             taskRepayString: JSON.stringify(params)
@@ -194,7 +205,7 @@ class AssignmentDetailPage extends React.Component {
                         <div className="homework-detail-top-name">{this.state.teachName}老师</div>
                         <div className='homework-detail-top-time'>
                             <span>截止时间:</span>
-                            <span >{this.state.endTime}</span>
+                            <span>{this.state.endTime}</span>
                         </div>
                     </div>
                 </div>
@@ -213,9 +224,9 @@ class AssignmentDetailPage extends React.Component {
 
                 </div>
                 <div className="margin_top_bottom_10 homework-detail-leave-caption">
-                    <img src={leave_img} style={{height:18,width:21,marginRight:10}}/>
+                    <img src={leave_img} style={{height: 18, width: 21, marginRight: 10}}/>
                     {this.state.data.length != 0 ? (
-                    <span>
+                        <span>
                         ({this.state.data.length}条)
                     </span>) : (<div></div>)}</div>
                 <div id="page_horizontal_line"></div>
@@ -227,10 +238,10 @@ class AssignmentDetailPage extends React.Component {
                     locale={{emptyText: '暂无留言'}}
                     dataSource={this.state.data}
                     renderItem={item => (
-                            <div style={{display: 'flex',paddingTop:5,paddingBottom:5}}>
-                                <div className="homework-detail-leave-name">{item.name}:</div>
-                                <div className='homework-detail-leave-content'>{item.content}</div>
-                            </div>
+                        <div style={{display: 'flex', paddingTop: 5, paddingBottom: 5}}>
+                            <div className="homework-detail-leave-name">{item.name}:</div>
+                            <div className='homework-detail-leave-content'>{item.content}</div>
+                        </div>
                     )}/>
             </div>
             {this.state.role === "teacher" ? "" :

+ 2 - 2
frontend/wechat-web/src/modules/leave/LeaveItem.js

@@ -29,8 +29,8 @@ export default class LeaveItem extends Component {
                                         <div>
                                             {
                                                 item.leaveMessages.length == 0 ?
-                                                    <div style={{fontSize: 12, color: "#FA5200"}}>未查阅</div>
-                                                    : <div style={{fontSize: 12, color: "##686868"}}>已查阅</div>
+                                                    <div style={{fontSize: 12, color: "#FA5200"}}>未回复</div>
+                                                    : <div style={{fontSize: 12, color: "##686868"}}>已回复</div>
                                             }
                                         </div>
                                 }

+ 1 - 1
frontend/wechat-web/src/utils/common.js

@@ -446,7 +446,7 @@ export function randomNum(minNum, maxNum) {
 //解析url的search参数
 export function getSearchParams(searchStr) {
     let params = new Object();
-    if (searchStr.indexOf("?") != -1) {
+    if (!isObjEmpty(searchStr) && searchStr.indexOf("?") != -1) {
         searchStr = searchStr.substr(1);
         const searchArray = searchStr.split("&");
         for (let i = 0; i < searchArray.length; i++) {