From 50870e01b347db0f530c156287d7a87e03e615ce Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 6 Nov 2019 14:13:18 +0800
Subject: [PATCH 01/12] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E6=88=90=E7=BB=A9?=
=?UTF-8?q?=E8=BF=81=E7=A7=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...91106055638_migrate_2808_exercise_score.rb | 111 ++++++++++++++++++
1 file changed, 111 insertions(+)
create mode 100644 db/migrate/20191106055638_migrate_2808_exercise_score.rb
diff --git a/db/migrate/20191106055638_migrate_2808_exercise_score.rb b/db/migrate/20191106055638_migrate_2808_exercise_score.rb
new file mode 100644
index 000000000..ebf09e148
--- /dev/null
+++ b/db/migrate/20191106055638_migrate_2808_exercise_score.rb
@@ -0,0 +1,111 @@
+class Migrate2808ExerciseScore < ActiveRecord::Migration[5.2]
+ def challenge_path(path)
+ cha_path = path.present? ? path.split(";") : []
+ cha_path.reject(&:blank?)[0].try(:strip)
+ end
+
+ # 版本库文件内容,带转码
+ def git_fle_content(repo_path, path)
+ begin
+ Rails.logger.info("git file content: repo_path is #{repo_path}, path is #{path}")
+
+ content = GitService.file_content(repo_path: repo_path, path: path)
+
+ Rails.logger.info("git file content: content is #{content}")
+ decode_content = nil
+ if content.present?
+ content = content["content"] #6.24 -hs 这个为新增,因为当实训题里含有选择题时,这里会报错,undefined method `[]' for nil:NilClass
+
+ content = Base64.decode64(content)
+ cd = CharDet.detect(content)
+ Rails.logger.info "encoding: #{cd['encoding']} confidence: #{cd['confidence']}"
+ # 字符编码问题,GB18030编码识别率不行
+ decode_content =
+ if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8
+ content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '})
+ else
+ content.force_encoding('UTF-8')
+ end
+ end
+
+ decode_content
+
+ rescue Exception => e
+ Rails.logger.error(e.message)
+ raise Educoder::TipException.new("文档内容获取异常")
+ end
+ end
+
+ def calculate_student_score(exercise,user)
+ score5 = 0.0 #实训题
+ exercise_questions = exercise.exercise_questions.includes(:exercise_standard_answers,:exercise_shixun_challenges)
+ exercise_questions.each do |q|
+ if q.question_type == 5
+ q.exercise_shixun_challenges.each do |exercise_cha|
+ game = Game.user_games(user.id,exercise_cha.challenge_id)&.first #当前用户的关卡
+ if game.present?
+ exercise_cha_score = 0.0
+ answer_status = 0
+ # if game.status == 2 && game.final_score >= 0
+ if game.final_score > 0 && game.end_time < exercise.end_time
+ exercise_cha_score = game.real_score(exercise_cha.question_score)
+ # exercise_cha_score = exercise_cha.question_score #每一关卡的得分
+ answer_status = 1
+ end
+ ex_shixun_answer_content = exercise_cha.exercise_shixun_answers.where(user_id:user.id,exercise_question_id:q.id)
+ code = nil
+ if exercise_cha.challenge&.path.present?
+ cha_path = challenge_path(exercise_cha.challenge&.path)
+ game_challenge = game.game_codes.search_challenge_path(cha_path)&.first
+ if game_challenge.present?
+ game_code = game_challenge
+ code = game_code.try(:new_code)
+ else
+ begin
+ code = git_fle_content(game.myshixun.repo_path,cha_path)
+ rescue
+ code = ""
+ end
+ end
+ end
+ if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
+ ### Todo 实训题的_shixun_details里的代码是不是直接从这里取出就可以了?涉及到code的多个版本库的修改
+ sx_option = {
+ :exercise_question_id => q.id,
+ :exercise_shixun_challenge_id => exercise_cha.id,
+ :user_id => user.id,
+ :score => exercise_cha_score.round(1),
+ :answer_text => code,
+ :status => answer_status
+ }
+ ExerciseShixunAnswer.create!(sx_option)
+ else
+ ex_shixun_answer_content.first.update_attributes!(score:exercise_cha_score.round(1),answer_text:code,status:answer_status)
+ end
+ score5 += exercise_cha_score
+ else
+ score5 += 0.0
+ end
+ end
+ end
+ end
+ score5
+ end
+
+ def change
+ exercise = Exercise.find_by(id: 2808)
+ if exercise
+ exercise_users = exercise.exercise_users.where("start_at is not null and commit_status = 0")
+ exercise_users.each do |exercise_user|
+ calculate_score = calculate_student_score(exercise, exercise_user.user)
+ subjective_score = exercise_user.subjective_score
+ total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score
+ total_score = calculate_score + total_score_subjective_score
+ if exercise_user.end_at.nil?
+ exercise_user.update_attributes!(score:total_score,objective_score:calculate_score,end_at:exercise.end_time,commit_status:1,status:1,commit_method:3)
+ end
+ puts exercise_user.id
+ end
+ end
+ end
+end
From 23edade8f1974f93098bf0641ec30be3135a0854 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, 6 Nov 2019 16:04:30 +0800
Subject: [PATCH 02/12] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9Bbanne?=
=?UTF-8?q?r=E6=8A=A5=E5=90=8D=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../competitions/Competitioncommon/CompetitionCommon.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
index 86f22bcda..301fc8c1c 100755
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
@@ -267,7 +267,7 @@ class CompetitionCommon extends Component{
).then((response) => {
if (response.data.status === 0) {
// this.props.history.replace();
- this.Personalregistration(`/courses/${data.course_id}`)
+ window.open(`/courses/${data.course_id}`);
}
})
@@ -393,9 +393,9 @@ class CompetitionCommon extends Component{
{data.competition_status === "ended" ?
- this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
- onClick={ data.mode === 2 ?() => this.newgotocourse(`/courses/${data.course_id}`):() => this.newgotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
+ onClick={ data.mode === 2 ?data.member_of_course==true?() => this.newgotocourse(`/courses/${data.course_id}`):"":() => this.newgotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
>{data && data.member_count}
:data.competition_status === "nearly_published" ?
Date: Wed, 6 Nov 2019 16:09:31 +0800
Subject: [PATCH 03/12] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../competitions/Competitioncommon/CompetitionCommon.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
index 301fc8c1c..24792e137 100755
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
@@ -267,7 +267,9 @@ class CompetitionCommon extends Component{
).then((response) => {
if (response.data.status === 0) {
// this.props.history.replace();
+ this.getbannerdata()
window.open(`/courses/${data.course_id}`);
+
}
})
@@ -305,6 +307,7 @@ class CompetitionCommon extends Component{
if (response.data) {
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
// this.props.history.replace(urls);
+ this.getbannerdata()
window.open(urls)
}
}
From f56d0734150d7543d1fe31d684d709e9296d9cad Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Wed, 6 Nov 2019 16:16:50 +0800
Subject: [PATCH 04/12] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E9=99=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../user/modal/RealNameCertificationModal.js | 24 +++++++------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js
index cc5bfc2c6..8309cc5ca 100644
--- a/public/react/src/modules/user/modal/RealNameCertificationModal.js
+++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js
@@ -44,6 +44,7 @@ class RealNameCertificationModal extends Component{
this.state={
identity:"teacher",
departmentsName:undefined,
+ fileID:undefined,
filterSchoolList:undefined,
filterDepartments :undefined,
school:undefined,
@@ -269,7 +270,8 @@ class RealNameCertificationModal extends Component{
axios.post((url),{
name:values.name || basicInfo.name,
gender:parseInt(values.sex),
- id_number:values.credentials
+ id_number:values.credentials,
+ attachment_ids:[this.state.fileID]
}).then((result)=>{
if(result){
this.props.showNotification("申请已提交,请等待审核!");
@@ -295,7 +297,8 @@ class RealNameCertificationModal extends Component{
school_id:this.state.school_id,
department_id:this.state.department_id,
identity:this.state.identity,
- extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2
+ extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2,
+ attachment_ids:[this.state.fileID]
}).then((result)=>{
if(result){
this.props.showNotification("申请已提交,请等待审核!");
@@ -327,20 +330,7 @@ class RealNameCertificationModal extends Component{
const { course_lists, checkBoxValues } = this.state
this.onSendOk()
}
-
- handleChange = (info) => {
- if (info.file.status === 'uploading') {
- this.setState({ loading: true });
- return;
- }
- if (info.file.status === 'done') {
- // Get this url from response in real world.
- getBase64(info.file.originFileObj, imageUrl => this.setState({
- imageUrl,
- loading: false,
- }));
- }
- }
+
handleChange2 = (info) => {
if (info.file.status === 'uploading') {
this.setState({ loading: true });
@@ -348,9 +338,11 @@ class RealNameCertificationModal extends Component{
}
if (info.file.status === 'done') {
// Get this url from response in real world.
+ console.log(info.file.response);
getBase64(info.file.originFileObj, imageUrl2 => this.setState({
imageUrl2,
loading: false,
+ fileID:info.file.response && info.file.response.id
}));
}
}
From 913db26a8cef9fb022fbfee8127117fa69db3855 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Wed, 6 Nov 2019 16:23:18 +0800
Subject: [PATCH 05/12] competition certificate entry
---
app/controllers/competitions/competitions_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/competitions/competitions_controller.rb b/app/controllers/competitions/competitions_controller.rb
index 1eaa0dc22..6ab7e83a0 100644
--- a/app/controllers/competitions/competitions_controller.rb
+++ b/app/controllers/competitions/competitions_controller.rb
@@ -46,7 +46,7 @@ class Competitions::CompetitionsController < Competitions::BaseController
@competition_modules = @competition.unhidden_competition_modules
# 未登录、未获奖用户,不展示获奖证书栏目
- if !current_user.logged? || !current_competition.finished? || !current_competition.competition_prize_users.exists?(user: current_user)
+ if !current_user.logged? || !current_competition.finished? || (!current_competition.competition_prize_users.exists?(user: current_user) && !current_user.admin_or_business?)
@competition_modules = @competition_modules.select { |mod| mod.name != '获奖证书' }
end
From d2eeb28e4235edb830699e4170705f1a30027250 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 6 Nov 2019 16:26:17 +0800
Subject: [PATCH 06/12] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?=
=?UTF-8?q?=E5=92=8C=E8=81=8C=E4=B8=9A=E8=AE=A4=E8=AF=81=E7=9A=84=E5=9B=BE?=
=?UTF-8?q?=E7=89=87=E4=B8=8A=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 1 +
app/models/apply_user_authentication.rb | 1 +
.../admins/identity_auths/agree_apply_service.rb | 3 ++-
.../admins/identity_auths/refuse_apply_service.rb | 3 ++-
.../admins/professional_auths/agree_apply_service.rb | 3 ++-
.../admins/professional_auths/refuse_apply_service.rb | 3 ++-
app/services/users/apply_authentication_service.rb | 6 ++++--
app/services/users/apply_professional_auth_service.rb | 6 ++++--
.../identity_authentications/shared/_list.html.erb | 4 ++--
.../professional_authentications/shared/_list.html.erb | 10 +++++-----
10 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 258ab9d83..da6e99418 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -191,6 +191,7 @@ class AttachmentsController < ApplicationController
candown = current_user.member_of_course?(course)
end
tip_exception(403, "您没有权限进入") if course.present? && !candown
+ tip_exception(403, "您没有权限进入") if @file.container.is_a?(ApplyUserAuthentication)
end
end
end
diff --git a/app/models/apply_user_authentication.rb b/app/models/apply_user_authentication.rb
index 4f94202f6..ad74b0261 100644
--- a/app/models/apply_user_authentication.rb
+++ b/app/models/apply_user_authentication.rb
@@ -4,6 +4,7 @@ class ApplyUserAuthentication < ApplicationRecord
belongs_to :user
has_many :tidings, :as => :container, :dependent => :destroy
+ has_one :attachment, as: :container, dependent: :destroy
scope :real_name_auth, -> { where(auth_type: 1) }
scope :professional_auth, -> { where(auth_type: 2) }
diff --git a/app/services/admins/identity_auths/agree_apply_service.rb b/app/services/admins/identity_auths/agree_apply_service.rb
index 65a3b2376..d75a6d7db 100644
--- a/app/services/admins/identity_auths/agree_apply_service.rb
+++ b/app/services/admins/identity_auths/agree_apply_service.rb
@@ -14,7 +14,8 @@ class Admins::IdentityAuths::AgreeApplyService < ApplicationService
RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500)
deal_tiding!
- delete_auth_file!
+ apply.attachment&.destroy
+ # delete_auth_file!
end
end
diff --git a/app/services/admins/identity_auths/refuse_apply_service.rb b/app/services/admins/identity_auths/refuse_apply_service.rb
index 57581dd40..7ac2e6c38 100644
--- a/app/services/admins/identity_auths/refuse_apply_service.rb
+++ b/app/services/admins/identity_auths/refuse_apply_service.rb
@@ -12,7 +12,8 @@ class Admins::IdentityAuths::RefuseApplyService < ApplicationService
apply.update!(status: 2, remarks: reason)
deal_tiding!
- delete_auth_file!
+ apply.attachment&.destroy
+ # delete_auth_file!
end
end
diff --git a/app/services/admins/professional_auths/agree_apply_service.rb b/app/services/admins/professional_auths/agree_apply_service.rb
index 81654f0d3..1ca2da2fc 100644
--- a/app/services/admins/professional_auths/agree_apply_service.rb
+++ b/app/services/admins/professional_auths/agree_apply_service.rb
@@ -14,7 +14,8 @@ class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService
RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500)
deal_tiding!
- delete_auth_file!
+ apply.attachment&.destroy
+ # delete_auth_file!
end
end
diff --git a/app/services/admins/professional_auths/refuse_apply_service.rb b/app/services/admins/professional_auths/refuse_apply_service.rb
index b5332c999..a055488c3 100644
--- a/app/services/admins/professional_auths/refuse_apply_service.rb
+++ b/app/services/admins/professional_auths/refuse_apply_service.rb
@@ -12,7 +12,8 @@ class Admins::ProfessionalAuths::RefuseApplyService < ApplicationService
apply.update!(status: 2, remarks: reason)
deal_tiding!
- delete_auth_file!
+ apply.attachment&.destroy
+ # delete_auth_file!
end
end
diff --git a/app/services/users/apply_authentication_service.rb b/app/services/users/apply_authentication_service.rb
index c68260dcb..cab76b45c 100644
--- a/app/services/users/apply_authentication_service.rb
+++ b/app/services/users/apply_authentication_service.rb
@@ -22,9 +22,11 @@ class Users::ApplyAuthenticationService < ApplicationService
user.user_extension.update!(gender: params[:gender].to_i) if params[:gender].present?
- user.apply_user_authentication.create!(auth_type: 1, status: 0)
+ apply = user.apply_user_authentication.create!(auth_type: 1, status: 0)
- move_image_file! unless params[:upload_image].to_s == 'false'
+ Attachment.associate_container(params[:attachment_ids], apply.id, apply.class) if params[:attachment_ids]
+
+ # move_image_file! unless params[:upload_image].to_s == 'false'
end
# sms_notify_admin
diff --git a/app/services/users/apply_professional_auth_service.rb b/app/services/users/apply_professional_auth_service.rb
index 46a4658aa..81cd11a4c 100644
--- a/app/services/users/apply_professional_auth_service.rb
+++ b/app/services/users/apply_professional_auth_service.rb
@@ -34,9 +34,11 @@ class Users::ApplyProfessionalAuthService < ApplicationService
user.save!
extension.save!
- user.apply_user_authentication.create!(auth_type: 2, status: 0)
+ apply = user.apply_user_authentication.create!(auth_type: 2, status: 0)
- move_image_file! unless params[:upload_image].to_s == 'false'
+ Attachment.associate_container(params[:attachment_ids], apply.id, apply.class) if params[:attachment_ids]
+
+ # move_image_file! unless params[:upload_image].to_s == 'false'
end
# sms_notify_admin
diff --git a/app/views/admins/identity_authentications/shared/_list.html.erb b/app/views/admins/identity_authentications/shared/_list.html.erb
index c40d681ec..e1c603215 100644
--- a/app/views/admins/identity_authentications/shared/_list.html.erb
+++ b/app/views/admins/identity_authentications/shared/_list.html.erb
@@ -51,8 +51,8 @@
<% unless is_processed %>
- <% if File.exists?(disk_real_name_auth_filename(user.id)) %>
- <%= image_tag(real_name_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
+ <% if apply.attachment %>
+ <%= image_tag("/api/attachments/#{apply.attachment.id}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
<% else %>
<%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
<% end %>
diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb
index 79cf31aad..b80d0422f 100644
--- a/app/views/admins/professional_authentications/shared/_list.html.erb
+++ b/app/views/admins/professional_authentications/shared/_list.html.erb
@@ -48,11 +48,11 @@
<% unless is_processed %>
|
- <% if File.exists?(disk_professional_auth_filename(user.id)) %>
- <%= image_tag(professional_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
- <% else %>
- <%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
- <% end %>
+ <%# if apply.attachment %>
+ <%= image_tag("/api/attachments/#{apply.attachment.id}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
+ <%# else %>
+ <%#= content_tag(:span, '图片已删除', class: 'text-secondary') %>
+ <%# end %>
|
<% end %>
From 1130395f94e8b7ac162f171983f3807f41e83afd Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 6 Nov 2019 16:26:37 +0800
Subject: [PATCH 07/12] =?UTF-8?q?=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/page/readme.txt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/page/readme.txt b/public/react/src/modules/page/readme.txt
index f5e5646e9..dc22a971b 100644
--- a/public/react/src/modules/page/readme.txt
+++ b/public/react/src/modules/page/readme.txt
@@ -221,4 +221,8 @@ TPI SSH
VNCDisplay
- 使用的github上的代码 https://github.com/novnc/noVNC/
\ No newline at end of file
+ 使用的github上的代码 https://github.com/novnc/noVNC/
+
+
+tpi拖拽改变视图大小代码:
+js_min_all.js中搜索 doc.live('mousemove touchmove',function(e){
\ No newline at end of file
From 983ae533f6c407b873fca62762b42c6becb3aa3c Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Wed, 6 Nov 2019 16:26:44 +0800
Subject: [PATCH 08/12] hasGroupModule = () => {
---
public/react/src/modules/courses/members/studentsList.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js
index 91427534f..ac0f81356 100644
--- a/public/react/src/modules/courses/members/studentsList.js
+++ b/public/react/src/modules/courses/members/studentsList.js
@@ -107,7 +107,7 @@ const buildColumns = (that,isParent) => {
}
];
- if (course_groups && course_groups.length) {
+ if (that.hasGroupModule()) {
that.isStudentPage && columns.push({
title: '分班',
dataIndex: 'course_group_name',
@@ -249,6 +249,13 @@ class studentsList extends Component{
console.log(error)
});
}
+ hasGroupModule = () => {
+ const { course_modules } = this.props;
+ const result = course_modules && course_modules.filter( item => {
+ return item.type == 'course_group'
+ })
+ return result && result.length > 0
+ }
Downloadcal=()=>{
this.setState({
From d716950127ba22bf7dca94c88ce5183789dda08c Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 6 Nov 2019 16:27:26 +0800
Subject: [PATCH 09/12] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../professional_authentications/shared/_list.html.erb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb
index b80d0422f..0bf8ea4a3 100644
--- a/app/views/admins/professional_authentications/shared/_list.html.erb
+++ b/app/views/admins/professional_authentications/shared/_list.html.erb
@@ -48,11 +48,11 @@
<% unless is_processed %>
- <%# if apply.attachment %>
+ <% if apply.attachment %>
<%= image_tag("/api/attachments/#{apply.attachment.id}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
- <%# else %>
- <%#= content_tag(:span, '图片已删除', class: 'text-secondary') %>
- <%# end %>
+ <% else %>
+ <%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
+ <% end %>
|
<% end %>
From 792dc9a6ac70dc075239043efe107dbf72db369f Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 6 Nov 2019 16:29:11 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E7=9A=84=E5=88=86=E7=8F=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/students.json.jbuilder | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/courses/students.json.jbuilder b/app/views/courses/students.json.jbuilder
index 2790a81fc..93d05b623 100644
--- a/app/views/courses/students.json.jbuilder
+++ b/app/views/courses/students.json.jbuilder
@@ -5,7 +5,7 @@ json.students do
json.name student.user.try(:real_name)
json.name_link user_path(student.user)
json.student_id student.user.try(:student_id)
- json.course_group_name student.course_group.try(:name)
+ json.course_group_name student.course_group_name
json.course_member_id student.id
if @user_course_identity < Course::ASSISTANT_PROFESSOR && !params[:course_group_id].present?
json.member_roles student.user.course_role(@course)
From dd9887348031db93d221665d7ef8fa9ff71913e8 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, 6 Nov 2019 16:30:55 +0800
Subject: [PATCH 11/12] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Competitioncommon/CompetitionCommon.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
index 24792e137..eb8e661a4 100755
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
@@ -72,16 +72,19 @@ class CompetitionCommon extends Component{
}
//获取头部信息
getbannerdata=()=>{
- let menuid=this.props.location.search.replace('?menu=', '');
+ // let menuid=this.props.location.search.replace('?menu=', '');
+ let query=this.props.location&&this.props.location.search;
+ const types = query.split('&')
+ const menuid = types[0].split('?menu=')
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
data: response.data,
- thiskeys: menuid === undefined || menuid === "" ? response.data.competition_modules[0].id : menuid,
+ thiskeys: menuid[1] === undefined || menuid[1] === "" ? response.data.competition_modules[0].id : menuid[1],
mode: response.data.mode
})
- if(menuid===undefined||menuid===""){
+ if(menuid[1]===undefined||menuid[1]===""){
this.getrightdata(
response.data.competition_modules[0].id,
response.data.competition_modules[0].module_type,
@@ -91,7 +94,7 @@ class CompetitionCommon extends Component{
}else{
let newlist=response.data.competition_modules;
newlist.map((item,key)=>{
- if(`${item.id}`===`${menuid}`){
+ if(`${item.id}`===`${menuid[1]}`){
this.getrightdata(
item.id,
item.module_type,
From 3ac2f1501224f99cb9ca476eba1001361ccd9224 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 6 Nov 2019 16:33:35 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users/authentication_applies_controller.rb | 2 +-
app/controllers/users/professional_auth_applies_controller.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/users/authentication_applies_controller.rb b/app/controllers/users/authentication_applies_controller.rb
index 6a2c20893..8ded7be8b 100644
--- a/app/controllers/users/authentication_applies_controller.rb
+++ b/app/controllers/users/authentication_applies_controller.rb
@@ -17,6 +17,6 @@ class Users::AuthenticationAppliesController < Users::BaseAccountController
private
def create_params
- params.permit(:name, :gender, :id_number, :upload_image)
+ params.permit(:name, :gender, :id_number, :upload_image, :attachment_ids)
end
end
\ No newline at end of file
diff --git a/app/controllers/users/professional_auth_applies_controller.rb b/app/controllers/users/professional_auth_applies_controller.rb
index 5a9d305ff..ea546f047 100644
--- a/app/controllers/users/professional_auth_applies_controller.rb
+++ b/app/controllers/users/professional_auth_applies_controller.rb
@@ -17,6 +17,6 @@ class Users::ProfessionalAuthAppliesController < Users::BaseAccountController
private
def create_params
- params.permit(:school_id, :department_id, :identity, :extra, :upload_image)
+ params.permit(:school_id, :department_id, :identity, :extra, :upload_image, :attachment_ids)
end
end
\ No newline at end of file