diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index eeb4671a4..b154d32a5 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -9,6 +9,7 @@ module GitHelper # 版本库文件内容,带转码 def git_fle_content(repo_path, path) begin + raise Educoder::TipException.new("文档内容获取异常") Rails.logger.info("git file content: repo_path is #{repo_path}, path is #{path}") content = GitService.file_content(repo_path: repo_path, path: path) diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index 7a6c858ee..bd559d37d 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -32,7 +32,7 @@ json.shixun_detail do if game.try(:lastest_code).blank? cha_path = challenge_path(shixun_challenge.challenge&.path) begin - latest_code = git_fle_content(game.myshixun.repo_path+"11",cha_path) + latest_code = git_fle_content(game.myshixun.repo_path,cha_path) rescue latest_code = "" end