Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
jingquan huang 5 years ago
commit aba7ce2f19

@ -29,7 +29,6 @@ module GitCommon
def file_content def file_content
@content = git_fle_content @repo_path, @path @content = git_fle_content @repo_path, @path
Rails.logger.info("##############_____@content.present?___________########################{@content.present?}")
end end
# 版本库提交记录 # 版本库提交记录

@ -34,7 +34,8 @@ module GitHelper
rescue Exception => e rescue Exception => e
Rails.logger.error(e.message) Rails.logger.error(e.message)
raise Educoder::TipException.new("文档内容获取异常") Rails.logger.error("#####__________文档内容获取异常")
# raise Educoder::TipException.new("文档内容获取异常")
end end
end end

@ -9,6 +9,7 @@ json.start_date @course.start_date
json.end_date @course.end_date json.end_date @course.end_date
json.is_public @course.is_public json.is_public @course.is_public
json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type) json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type)
json.course_module_names @course.course_modules.where(hidden: 0).pluck(:module_name)
json.authentication @course.authentication json.authentication @course.authentication
json.professional_certification @course.professional_certification json.professional_certification @course.professional_certification
json.subject_id @course.subject_id json.subject_id @course.subject_id

@ -32,6 +32,7 @@ json.shixun_detail do
if game.try(:lastest_code).blank? if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path) cha_path = challenge_path(shixun_challenge.challenge&.path)
latest_code = git_fle_content(game.myshixun.repo_path,cha_path) latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
Rails.logger.info("#######_______latest_code______##########################{latest_code.present?}")
else else
latest_code = game.try(:lastest_code) latest_code = game.try(:lastest_code)
end end

@ -19,8 +19,8 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from "./modules/user/AccountProfile"; import AccountProfile from "./modules/user/AccountProfile";
import Trialapplication from './modules/login/Trialapplication' import Trialapplication from './modules/login/Trialapplication';
import Certifiedprofessional from './modules/modals/Certifiedprofessional';
import NotFoundPage from './NotFoundPage' import NotFoundPage from './NotFoundPage'
import Loading from './Loading' import Loading from './Loading'
@ -247,12 +247,24 @@ const Messagerouting= Loadable({
class App extends Component { class App extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
// this.state = { this.state = {
// isRenders:false, mydisplay:false
// } }
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
Addcoursestypes:false,
mydisplay:true,
occupation:i,
})
};
ModalCancelsy=()=>{
this.setState({
mydisplay:false,
})
};
componentDidMount() { componentDidMount() {
// force an update if the URL changes // force an update if the URL changes
history.listen(() => { history.listen(() => {
@ -304,8 +316,8 @@ class App extends Component {
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl> <Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/> <Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/> <AccountProfile {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/>
{/*<Certifiedprofessional {...this.props} {...this.state}/>*/} <Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy}/>
<Router> <Router>
<Switch> <Switch>

@ -66,12 +66,12 @@ class Goldsubject extends Component {
const { datatime } = this.state; const { datatime } = this.state;
var datatimes=""; var datatimes="";
if(datatime!==undefined){ // if(datatime!==undefined){
datatimes=datatime; // datatimes=datatime;
datatimes=moment(datatimes, dateFormat).subtract(0, 'days');; datatimes=moment(datatime, dateFormat);
}else { // }else {
datatimes=datatime; // datatimes=datatime;
} // }
if (!startValue || !datatimes) { if (!startValue || !datatimes) {
return false; return false;
} }
@ -84,12 +84,12 @@ class Goldsubject extends Component {
// console.log(moment(new Date(), dateFormat).add(2, 'days')); // console.log(moment(new Date(), dateFormat).add(2, 'days'));
const { datatimetwo } = this.state; const { datatimetwo } = this.state;
var startvalue=""; var startvalue="";
if(datatimetwo!==undefined){ // if(datatimetwo!==undefined){
startvalue=datatimetwo; // startvalue=datatimetwo;
startvalue=moment(startvalue, dateFormat).add(1, 'days'); startvalue=moment(datatimetwo, dateFormat);
}else { // }else {
startvalue=datatimetwo; // startvalue=datatimetwo;
} // }
// console.log("结束时间"); // console.log("结束时间");
// console.log(endValue); // console.log(endValue);
// console.log(startvalue); // console.log(startvalue);
@ -359,9 +359,12 @@ class Goldsubject extends Component {
}); });
} else { } else {
debugger
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
console.log("错误信息信息信息2"); console.log("错误信息信息信息2");
console.log(err); console.log(err);
console.log("xingxixingxi");
if (err) { if (err) {
return; return;
} }
@ -384,17 +387,22 @@ class Goldsubject extends Component {
// console.log('Received values of form: ', values); // console.log('Received values of form: ', values);
let subjectid = this.props.match.params.subjectid; let subjectid = this.props.match.params.subjectid;
let url = "/courses.json"; let url = "/courses.json";
axios.post(url, { var ysldatas={
subject_id:subjectid, //这是带过来的值 subject_id:subjectid, //这是带过来的值
name: values.classroom, name: values.classroom,
class_period: values.period, class_period: values.period,
credit: parseFloat(values.credit), credit: parseFloat(values.credit),
start_date:values.starttime, start_date:values.starttime,
end_date: values.endtime, end_date: values.endtime,
is_public: is_public, //这是也是带过来的值 is_public: is_public, //这是也是带过来的值
course_module_types: values.checkboxgroup, course_module_types: values.checkboxgroup,
school:values.school school:values.school
} };
console.log("提交的ysldatas数据");
console.log(ysldatas);
console.log(JSON.stringify(ysldatas));
axios.post(url,
ysldatas
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
// this.goback // this.goback

Loading…
Cancel
Save