From de47c662636162f421241dd390242d9c965c3a08 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 4 Sep 2019 10:26:21 +0800
Subject: [PATCH 01/13] real
---
public/react/src/modules/courses/busyWork/CommonWorkPost.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js
index 312756ec4..ed96914de 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js
@@ -646,7 +646,7 @@ render(){
{/*>*/}
{/**/}
- {`${current_user ? current_user.username : ''} ${ this.isEdit ? '编辑' : '提交'}作品` }
+ {`${current_user ? current_user.real_name : ''} ${ this.isEdit ? '编辑' : '提交'}作品` }
From c80adad2030753c1400845aacdc17a0c00c449f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 4 Sep 2019 10:32:04 +0800
Subject: [PATCH 02/13] =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E7=BB=93=E6=9D=9F?=
=?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E4=B8=8D?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AE=A1=E7=AE=97=E6=88=90=E7=BB=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/shixunHomework/Listofworksstudentone.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 64e2e6a99..a803ecdd2 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -2499,6 +2499,8 @@ class Listofworksstudentone extends Component {
// console.log(data);
// console.log(datas);
// console.log(this.props.isAdmin());
+
+ let course_is_end = this.props.current_user&&this.props.current_user.course_is_end;
return (
this.props.isAdmin() === true ?
(
@@ -2639,7 +2641,7 @@ class Listofworksstudentone extends Component {
-
计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}
-
+ {course_is_end===true?
{teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true?
(this.props.isNotMember()===false?
计算成绩
@@ -2649,7 +2651,7 @@ class Listofworksstudentone extends Component {
计算成绩
:"")
}
-
+ :""}
计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}
- {teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":
+ { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":
{computeTimetype===true?
(this.props.isNotMember()===false?
@@ -3154,7 +3156,7 @@ class Listofworksstudentone extends Component {
计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}
- {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":
+ { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":
{computeTimetype===true?
(this.props.isNotMember()===false?
计算成绩
From d34f4a300276f1e3115fb12d2da5ecc5157f55d5 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Wed, 4 Sep 2019 10:52:21 +0800
Subject: [PATCH 03/13] js sdk api
---
app/controllers/wechats/js_sdk_signatures_controller.rb | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/controllers/wechats/js_sdk_signatures_controller.rb b/app/controllers/wechats/js_sdk_signatures_controller.rb
index e4ee0da27..6d7b3d87d 100644
--- a/app/controllers/wechats/js_sdk_signatures_controller.rb
+++ b/app/controllers/wechats/js_sdk_signatures_controller.rb
@@ -1,7 +1,10 @@
class Wechats::JsSdkSignaturesController < ApplicationController
def create
- signature = Util::Wechat.js_sdk_signature(params[:url], params[:noncestr], params[:timestamp])
- render_ok(signature: signature)
+ timestamp = (Time.now.to_f * 1000).to_i
+ noncestr = ('A'..'z').to_a.sample(8).join
+ signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp)
+
+ render_ok(appid: Util::Wechat.appid, timestamp: timestamp, noncestr: noncestr, signature: signature)
rescue Util::Wechat::Error => ex
render_error(ex.message)
end
From 308e582d8d851b2d1ebc1695a964628461a32e03 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 4 Sep 2019 13:39:29 +0800
Subject: [PATCH 04/13] =?UTF-8?q?=E5=8F=AA=E8=83=BD=E4=B8=80=E4=B8=AA?=
=?UTF-8?q?=E9=99=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/tpm/TPMsettings/TPMsettings.js | 18 ++++++++++++------
.../src/modules/tpm/newshixuns/Newshixuns.js | 18 +++++++++++-------
2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
index e277ad85f..f1184e7b7 100644
--- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
+++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
@@ -15,7 +15,7 @@ import axios from 'axios';
import './css/TPMsettings.css';
-import { getImageUrl, toPath, getUrl ,appendFileSizeToUploadFileAll} from 'educoder';
+import { getImageUrl, toPath, getUrl ,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
let origin = getUrl();
@@ -1372,15 +1372,18 @@ export default class TPMsettings extends Component {
})
}
+
handleChange = (info) => {
+ let {fileList}=this.state;
+
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1");
- let {fileList}=this.state;
- if(fileList.length===0){
+
+ // if(fileList.length===0){
let fileLists = info.fileList;
this.setState({ fileList:fileLists,
deleteisnot:false});
- }
+ // }
}
}
@@ -1497,10 +1500,13 @@ export default class TPMsettings extends Component {
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
- action: `${getUrl()}/api/attachments.json`,
+ action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
- beforeUpload: (file) => {
+ beforeUpload: (file, fileList) => {
+ if (this.state.fileList.length >= 1) {
+ return false
+ }
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) {
diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js
index cc178dbe0..d7b2b7d26 100644
--- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js
+++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js
@@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
-import {SnackbarHOC,appendFileSizeToUploadFileAll} from 'educoder';
+import {SnackbarHOC,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification,Tooltip} from 'antd';
@@ -757,19 +757,19 @@ class Newshixuns extends Component {
})
}
-
// 附件相关 START
handleChange = (info) => {
+ let {fileList}=this.state;
+
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
- let {fileList}=this.state;
console.log("handleChange1");
- if(fileList.length===0){
+ // if(fileList.length===0){
let fileLists = info.fileList;
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList:fileLists,
deleteisnot:false});
- }
+ // }
}
}
@@ -872,10 +872,14 @@ class Newshixuns extends Component {
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
- action: `${getUrl()}/api/attachments.json`,
+ action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
- beforeUpload: (file) => {
+ beforeUpload: (file, fileList) => {
+
+ if (this.state.fileList.length >= 1) {
+ return false
+ }
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) {
From c4756cde6711df13cbfafec211673886426bbaad Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 4 Sep 2019 14:03:52 +0800
Subject: [PATCH 05/13] https://www.trustie.net/issues/23867
---
public/react/src/modules/comment/Comments.js | 4 ++--
.../src/modules/courses/boards/TopicDetail.js | 8 +++++---
public/react/src/modules/courses/boards/index.js | 5 +++--
.../modules/courses/coursesDetail/CoursesBanner.js | 14 +++++++-------
.../src/modules/courses/members/studentsList.js | 3 ++-
public/react/src/modules/tpm/TPMIndexHOC.js | 6 ++++++
6 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js
index ae246197c..836b520cc 100644
--- a/public/react/src/modules/comment/Comments.js
+++ b/public/react/src/modules/comment/Comments.js
@@ -383,12 +383,12 @@ class Comments extends Component {
{/* |*/}
- this.initReply(item) } >
-
+ }
{/* |*/}
diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js
index 542157bfb..8ecc85565 100644
--- a/public/react/src/modules/courses/boards/TopicDetail.js
+++ b/public/react/src/modules/courses/boards/TopicDetail.js
@@ -527,6 +527,7 @@ class TopicDetail extends Component {
// TODO 图片上传地址
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
+ const isCourseEnd = this.props.isCourseEnd()
return (
{/* fl with100 */}