From 814aa13c21518c8c463761e09e8c993364ed1c98 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 30 Jul 2019 14:05:26 +0800 Subject: [PATCH 01/62] =?UTF-8?q?Mp3=E3=80=81mp4=E7=B1=BB=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=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/controllers/games_controller.rb | 2 +- app/controllers/myshixuns_controller.rb | 2 +- app/helpers/games_helper.rb | 8 +++++++- app/models/challenge.rb | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index b2de6dcad..667d45f2b 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -116,7 +116,7 @@ class GamesController < ApplicationController @qrcode_str = Base64.encode64( qr.to_img.resize(400,400).to_s ) else - @type = "image" + @type = "" #conv = Iconv.new("GBK", "utf-8") @game_challenge = @game.challenge type = @game_challenge.show_type diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index fa47fd7f6..1d6b15969 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -24,7 +24,7 @@ class MyshixunsController < ApplicationController ActiveRecord::Base.transaction do begin @shixun = Shixun.select(:id, :identifier).find(@myshixun.shixun_id) - @myshixun.destroy + @myshixun.destroy! StudentWork.where(:myshixun_id => @myshixun.id).update_all(:myshixun_id => 0, :work_status => 0) diff --git a/app/helpers/games_helper.rb b/app/helpers/games_helper.rb index aff05904f..dfc3fb321 100644 --- a/app/helpers/games_helper.rb +++ b/app/helpers/games_helper.rb @@ -6,7 +6,7 @@ module GamesHelper end # 获取目录下所有文件,返回一个文件名的数组 type是查看文件的类型image表示图片 - # type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"]] + # type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"], [5, "mp3"], [6, "mp4"]] def get_dir_filename(path, type, game_id) answer_picture = [] return answer_picture unless File.directory?(path) @@ -39,6 +39,12 @@ module GamesHelper end f.close @type = 'txt' + elsif extension == 'mp3' && type == 5 + answer_picture << file + @type = 'mp3' + elsif extension == 'mp4' && type == 6 + answer_picture << file + @type = 'mp4' end end diff --git a/app/models/challenge.rb b/app/models/challenge.rb index 0bea54eb4..8e4d2ae42 100644 --- a/app/models/challenge.rb +++ b/app/models/challenge.rb @@ -1,5 +1,6 @@ class Challenge < ApplicationRecord # difficulty: 关卡难度: 1.简单 2.中等 3.困难 + # show_type: 效果展示:-1.无效果 1.图片 2.apk/exe 3.txt 4.html 5.mp3 6.mp4 default_scope { order("challenges.position asc") } belongs_to :shixun, :touch => true, counter_cache: true From 1cb74baff7c2cc16a17e9055aa14f22f2de81205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 30 Jul 2019 15:01:05 +0800 Subject: [PATCH 02/62] b --- .../PackageIndexNEIBannerConcent.js | 4 +- public/react/src/modules/tpm/NewHeader.js | 2 +- .../react/src/modules/user/usersInfo/Infos.js | 27 ++- .../modules/user/usersInfo/InfosPackage.js | 197 ++++++++++++++++++ 4 files changed, 225 insertions(+), 5 deletions(-) create mode 100644 public/react/src/modules/user/usersInfo/InfosPackage.js diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index c9d49e542..e4926e02c 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -69,7 +69,7 @@ class PackageIndexNEIBannerConcent extends Component { componentDidUpdate = (prevProps) => { if(prevProps.current_user.username!=this.props.current_user.username){ this.setState({ - contact_name:this.props.current_user.username + contact_name:this.props.current_user&&this.props.current_user.username }) } } @@ -100,7 +100,7 @@ class PackageIndexNEIBannerConcent extends Component { }) }else{ this.setState({ - contact_name:this.props.current_user.username + contact_name:this.props.current_user&&this.props.current_user.username }) } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 1798bfca8..79b0aa443 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -816,7 +816,7 @@ submittojoinclass=(value)=>{
+ 共{totalCount}个 + 发布时间 +
+非成员不能访问
++ {item.name} +
+ +{item.teacher && item.teacher.real_name}
+{item.teacher && item.teacher.school_name}
+{item.name}
非成员不能访问
-- {item.name} -
- -{item.teacher && item.teacher.real_name}
-{item.teacher && item.teacher.school_name}
-- 共{totalCount}个 + 共{0}个 发布时间
-
{this.props.match.params.id!=undefined?"编辑":"新建"} + 返回
J z`vq9a6$7hJ1&2qZJ!o9Qk41Z~x68j?ZQYC6II{U zp*BsSWza87`9xx)J>-q8+%g^rB_iTy8wR3NRY{C0O;H K_VahicJ zup(zSS{m@7HLp+VA@O9Woq>-$zawahND#DN=H)_Sg^H&tTwFk3?hmUa1$6PnzlPS_ z!{;0AK2GEaE;fWSDkj#=-c6(c$wU;OP+&P-6ua*hfV)y1_;@g`7I@0@`Fw!y23WvC zQ^T+`|3Kp5g(7y$pRUXT!&aoVRue9Sq9EyNai$)DfG>Z({PvVFV4BWR8MuFP)^(uo zvgsHLXv%MmtJa0p@9G=|o(x=G4%u898a-}fhdnvb5 eWG ztbCa3xPxJhU}Zo~%&Bmd9Fy3@D?#dCU1^(-N_fX{A}t3Jl &~8cC#yWul>K8nzjhRV@I10@Tm*sJt3hkCGhqW(4d#vciQLJ7X)r(;aH9 zkS)XK1O9@0f5!Y9fJNu1_Tcro@z+BaUR%yiY~Q~Gu`!2a6)sE5|6*0~@-sfWOTC)P zL_+*!0cLMqFgird95_d9U3u0~ruRyraI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