Merge branches 'dev_aliyun' and 'master' of https://bdgit.educoder.net/Hjqreturn/educoder

dev_forum
杨树明 5 years ago
commit e4c44d4a16

@ -5,7 +5,7 @@ class CourseSecondCategory < ApplicationRecord
belongs_to :course_module
has_many :homework_commons
validates :name, length: { maximum: 30 }
validates :name, length: { maximum: 60 }
def category_type_str
category_type == "graduation" && name == "毕设选题" ? "graduation_topics" : (

@ -0,0 +1,15 @@
class ModifyFinalScoreForGames < ActiveRecord::Migration[5.2]
def change
grades = Grade.where(container_type: "Answer")
grades.each do |grade|
g = Game.find_by_id(grade.container_id)
if g.present?
if g.status == 2 && g.answer_open > 0 && g.final_score <= 0 && g.end_time < grade.created_at
g.update_column(:final_score, g.challenge.score)
elsif g.final_score < 0
g.update_column(:final_score, 0)
end
end
end
end
end

@ -139,7 +139,7 @@ class PathDetailIndex extends Component{
let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{
if (result.data.status == 407) {
if (result.data.status == 407 || result.data.status == 401) {
return;
}
if(result.data.allow_visit===true){
@ -164,9 +164,11 @@ class PathDetailIndex extends Component{
let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{
if (result.data.status == 407) {
// TODO 403 让后台返回status 403 比较好
if (result.data.status == 407 || result.data.status == 401) {
return;
}
if(result.data.allow_visit===true){
this.setState({
detailInfoList:result.data,

Loading…
Cancel
Save