From ca3edc22db6177574fb22eae469cbd8376149552 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 13 Aug 2019 09:18:17 +0800 Subject: [PATCH 1/6] d --- 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 60383988b..7f4020590 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -278,7 +278,7 @@ class CommonWorkPost extends Component{ } // 附件相关 START handleChange = (info) => { - if (info.file.status === 'uploading') { + if (info.file.status === 'uploading' || info.file.status === 'done') { let fileList = info.fileList; this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); From 2e53af0f4fbfb150efd549c98b30840eed06d23d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 13 Aug 2019 09:19:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise_questions/_exercise_questions.json.jbuilder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/exercise_questions/_exercise_questions.json.jbuilder b/app/views/exercise_questions/_exercise_questions.json.jbuilder index 51c30ad92..61bf919ea 100644 --- a/app/views/exercise_questions/_exercise_questions.json.jbuilder +++ b/app/views/exercise_questions/_exercise_questions.json.jbuilder @@ -17,7 +17,8 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选 end json.question_choices do json.array! exercise_choices.each_with_index.to_a do |a,index| - standard_answer_b = standard_answers_array.include?(a.choice_position) + #TODO: 旧版本来答案都是存在exercise_choice_id里面的,但是新版做成了一对多的关系,exercise_choice_id只存了一个答案,导致了问题 + standard_answer_b = standard_answers_array.join("").include?(a.choice_position.to_s) user_answer_b = user_answer.include?(a.id) json.c_position (index+1) if ex_choice_random_boolean #当选项随机时,选项位置以此为准,否则不出现 json.choice_id a.id From db5e58a911db6961966decde404d0eb129d1f5fc Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 13 Aug 2019 09:22:15 +0800 Subject: [PATCH 3/6] modify video batch publish apu --- app/controllers/users/videos_controller.rb | 2 ++ app/services/videos/batch_publish_service.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb index 03acd76cc..e4dffec23 100644 --- a/app/controllers/users/videos_controller.rb +++ b/app/controllers/users/videos_controller.rb @@ -40,6 +40,8 @@ class Users::VideosController < Users::BaseController def batch_publish Videos::BatchPublishService.call(observed_user, batch_publish_params) render_ok + rescue Videos::BatchPublishService::Error => ex + render_error(ex.message) end private diff --git a/app/services/videos/batch_publish_service.rb b/app/services/videos/batch_publish_service.rb index 3ff16dc57..e435b9508 100644 --- a/app/services/videos/batch_publish_service.rb +++ b/app/services/videos/batch_publish_service.rb @@ -1,4 +1,6 @@ class Videos::BatchPublishService < ApplicationService + Error = Class.new(StandardError) + attr_reader :user, :params def initialize(user, params) @@ -16,6 +18,8 @@ class Videos::BatchPublishService < ApplicationService video = user.videos.find_by(uuid: param[:video_id]) next if video.blank? || video.processing_video_apply.present? + raise Error, '视频还未上传完成' if video.vod_uploading? + video.title = param[:title].to_s.strip.presence || video.title video.apply_publish video.save! From cbff39697f381ed0df64f778269d697d48fcf8c5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 13 Aug 2019 10:36:36 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=88=86=E7=8F=AD=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E4=BF=AE=E6=94=B9=E6=88=9060=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course_group.rb | 2 +- app/views/exercise_questions/_exercise_questions.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/course_group.rb b/app/models/course_group.rb index 33e40ee52..d57edf497 100644 --- a/app/models/course_group.rb +++ b/app/models/course_group.rb @@ -8,7 +8,7 @@ class CourseGroup < ApplicationRecord has_many :homework_group_reviews, :dependent => :destroy scope :by_group_ids, lambda { |ids| where(id: ids)} - validates :name, length: { maximum: 20 } + validates :name, length: { maximum: 60 } after_create :generate_invite_code diff --git a/app/views/exercise_questions/_exercise_questions.json.jbuilder b/app/views/exercise_questions/_exercise_questions.json.jbuilder index 61bf919ea..bbdf45440 100644 --- a/app/views/exercise_questions/_exercise_questions.json.jbuilder +++ b/app/views/exercise_questions/_exercise_questions.json.jbuilder @@ -17,7 +17,7 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选 end json.question_choices do json.array! exercise_choices.each_with_index.to_a do |a,index| - #TODO: 旧版本来答案都是存在exercise_choice_id里面的,但是新版做成了一对多的关系,exercise_choice_id只存了一个答案,导致了问题 + #TODO: 旧版本来一个题只有一个标准答案的,新版又做成了一个题有多个标准答案(exercise_choice_id存放的是标准答案的位置..) standard_answer_b = standard_answers_array.join("").include?(a.choice_position.to_s) user_answer_b = user_answer.include?(a.id) json.c_position (index+1) if ex_choice_random_boolean #当选项随机时,选项位置以此为准,否则不出现 From 10a889388edc31395fd5c5d289d3db962d3d25b5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 13 Aug 2019 11:05:24 +0800 Subject: [PATCH 5/6] console --- public/react/src/common/UrlTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index f224526e6..1a910f224 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -13,7 +13,7 @@ export function getImageUrl(path) { export function setImagesUrl(path){ const local = 'http://47.96.87.25:48080' let firstStr=path.substr(0,1); - console.log(firstStr); + // console.log(firstStr); if(firstStr=="/"){ return isDev?`${local}${path}`:`${path}`; }else{ From e8a06972566b723db26d8c361121bdb09b660a8d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 13 Aug 2019 11:07:37 +0800 Subject: [PATCH 6/6] error --- public/react/src/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/react/src/App.js b/public/react/src/App.js index e71ce4a9a..8004e05f8 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -274,6 +274,11 @@ class App extends Component { // }, (error) => { // //TODO 这里如果样式变了会出现css不加载的情况 // }); + + window.addEventListener('error', (event) => { + const msg = `${event.type}: ${event.message}`; + console.log(msg) + }); } //修改登录方法 Modifyloginvalue=()=>{