diff --git a/app/controllers/ecloud_controller.rb b/app/controllers/ecloud_controller.rb index edf568a9..c49b34a6 100644 --- a/app/controllers/ecloud_controller.rb +++ b/app/controllers/ecloud_controller.rb @@ -33,10 +33,18 @@ class EcloudController < ApplicationController def trustie_login end - CLIENT_ID = '1022' - CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668' - ROOT_URl = 'http://localhost:3000' - SERVER_URL = "https://221.176.54.92:9081/restful/services/" + # 测试环境 + # CLIENT_ID = '1022' + # CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668' + # SERVER_URL = "https://221.176.54.92:9081/restful/services/" + # + + # 正式环境 + CLIENT_ID = '1056' + CLIENT_SECRET = '2e84256a-3de4-4713-9e02-10ee88a14592' + SERVER_URL = "https://221.176.53.130:44390/services/" + + ## 签名 def sign(timestamp) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 919e374b..19c82857 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4340,7 +4340,7 @@ module ApplicationHelper candown = (attachment.is_public == 1 || attachment.is_public == true) end else - if attachment.container_type == "MarkDown" || attachment.container_type == "Shixun" || attachment.container_type == "Memo" || attachment.container_type == "Career" || attachment.container_type == "Exercise" || attachment.container_type == "ExerciseBank" + if attachment.container_type == "MarkDown" || attachment.container_type.nil? || attachment.container_type == 'Subject' || attachment.container_type == "Shixun" || attachment.container_type == "Memo" || attachment.container_type == "Career" || attachment.container_type == "Exercise" || attachment.container_type == "ExerciseBank" candown = true end end diff --git a/app/views/subjects/_new_or_edit.html.erb b/app/views/subjects/_new_or_edit.html.erb index b5d15a26..c7c9beed 100644 --- a/app/views/subjects/_new_or_edit.html.erb +++ b/app/views/subjects/_new_or_edit.html.erb @@ -78,7 +78,7 @@ placeholder: "请在此输入实训课程的简介", imageUpload : true, imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url + imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => 'MarkDown') %>" //url }); md_elocalStorage(shixun_editormd, "subject_desc_<%= User.current.id %>", "desc"); /* --------------------------------- 学习须知 -------------------------------------- */ @@ -106,7 +106,7 @@ placeholder: "请在此输入实训课程的学习须知", imageUpload : true, imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url + imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => 'MarkDown') %>" //url }); md_elocalStorage(shixun_propaedeutics, "subject_notes_<%= User.current.id %>", "notes");