diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 237f4b350..262fbd50c 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -93,7 +93,8 @@ class MyshixunsController < ApplicationController ActiveRecord::Base.transaction do begin t1 = Time.now - jsonTestDetails = JSON.parse(params[:jsonTestDetails].to_json) + Rails.logger.info("@@@222222#{params[:jsonTestDetails]}") + jsonTestDetails = JSON.parse(params[:jsonTestDetails]) timeCost = JSON.parse(params[:timeCost]) brige_end_time = Time.parse(timeCost['evaluateEnd']) if timeCost['evaluateEnd'].present? return_back_time = format("%.3f", ( t1.to_f - brige_end_time.to_f)).to_f @@ -212,10 +213,10 @@ class MyshixunsController < ApplicationController end uid_logger("training_task_status start#4**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") sucess_status - rescue Exception => e - tip_exception(e.message) - uid_logger_error("training_task_status error: #{e}") - raise ActiveRecord::Rollback + # rescue Exception => e + # tip_exception(e.message) + # uid_logger_error("training_task_status error: #{e}") + # raise ActiveRecord::Rollback end end end diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 7b9795e80..0abd707af 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -301,8 +301,8 @@ module.exports = { }, warnings: false, compress: { - drop_debugger: true, - drop_console: true + drop_debugger: false, + drop_console: false } } }), diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 003ef5a9b..02d8c2be5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -2,7 +2,7 @@ import React from "react"; import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; -import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString} from 'educoder'; +import { broadcastChannelOnmessage ,SetAppModel} from 'educoder'; import { notification } from 'antd'; import './index.css' broadcastChannelOnmessage('refreshPage', () => { @@ -18,19 +18,10 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -let debugType = "" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || '' -} - -window._debugType = debugType; +const debugType ="" +// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' +// window._debugType = debugType; export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation @@ -121,7 +112,7 @@ export function initAxiosInterceptors(props) { // https://github.com/axios/axios/issues/583 // message.info(response.data.message || '服务端返回status -1,请联系管理员。'); // props.showSnackbar( response.data.message || '服务器异常,请联系管理员。' ) - if (window.location.pathname.startsWith('/tasks/')) { + if (window.location.pathname.startsWith('/tasks/')) { props.showSnackbar( response.data.message || '服务器异常,请联系管理员。' ) } else { notification.open({ @@ -136,7 +127,7 @@ export function initAxiosInterceptors(props) { // description: response.data.message || '服务器异常,请联系管理员。', // }); } - + throw new axios.Cancel('Operation canceled by the user.'); } // if(response.data.status === 401){ diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index e8bd8b9cf..922c68650 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -147,6 +147,8 @@ class Addcourses extends Component{ if(Addcoursestype===true){ this.props.hideAddcoursestype(); + }else{ + window.location.href = "/"; } } diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index c5d0009c1..1183b59e9 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -88,11 +88,11 @@ class CoursesNew extends Component { } componentDidUpdate(prevProps){ - if(prevProps.current_user!=this.props.current_user){ - if(this.props.current_user.user_identity==="学生"){ - window.location.href ="/403" - } - } + // if(prevProps.current_user!=this.props.current_user){ + // if(this.props.current_user.user_identity==="学生"){ + // window.location.href ="/403" + // } + // } } onChangeTimepublishs = (date, dateString) => { if(dateString===""){ @@ -132,7 +132,7 @@ class CoursesNew extends Component { e.preventDefault(); let coursesId = this.props.match.params.coursesId; - let {is_public} = this.state + let {is_public,datatime} = this.state // console.log(is_public) if (coursesId != undefined) { @@ -173,7 +173,7 @@ class CoursesNew extends Component { // console.log('Received values of form: ', values); - let {datatime} = this.state; + let url = "/courses/" + coursesId + ".json"; axios.put(url, { course_list_name: values.course, @@ -227,7 +227,7 @@ class CoursesNew extends Component { // debugger //新建 // console.log('Received values of form: ', values); - let {datatime} = this.state; + let url = "/courses.json"; axios.post(url, { course_list_name: values.course, diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index 5f41cdefb..61ed59d7b 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -382,7 +382,7 @@ class ShixunhomeWorkItem extends Component{ 实训详情 {this.props.isAdminOrCreator()?this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名:""} {/* 设置*/} - 设置 + 设置 :""} diff --git a/public/react/src/modules/login/LoginDialog.css b/public/react/src/modules/login/LoginDialog.css index 34a711154..7be7b12cc 100644 --- a/public/react/src/modules/login/LoginDialog.css +++ b/public/react/src/modules/login/LoginDialog.css @@ -9,7 +9,7 @@ /* z-index: 20000; */ } #DialogID .dialogBox { - width: 402px; + width: 400px; } .MuiPaper-elevation24-45{ box-shadow:none !important; @@ -24,7 +24,7 @@ top: 0px !important; } #log_reg_content{ - width:400px !important; + width:405px !important; border-radius:6px; box-shadow:4px 8px 12px rgba(76,76,76,0.3); } diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index ebb4b98c2..313d5bce3 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -406,7 +406,7 @@ class Trialapplication extends Component { top: 0px !important; } #log_reg_content{ - width:400px !important; + width:405px !important; border-radius:40px !important; box-shadow:4px 8px 12px rgba(76,76,76,0.3); } diff --git a/public/react/src/modules/login/Trialapplicationysl.js b/public/react/src/modules/login/Trialapplicationysl.js index e2afac010..dc9755fbe 100644 --- a/public/react/src/modules/login/Trialapplicationysl.js +++ b/public/react/src/modules/login/Trialapplicationysl.js @@ -424,7 +424,7 @@ class Trialapplicationysl extends Component { top: 0px !important; } #log_reg_content{ - width:400px !important; + width:405px !important; border-radius:40px !important; box-shadow:4px 8px 12px rgba(76,76,76,0.3); } diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index bb410c1ce..7211fde5e 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -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, diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index da8e71a40..37fac626d 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -487,20 +487,22 @@ submittojoinclass=(value)=>{ } showSearchOpen=(e)=>{ + debugger this.setState({ showSearchOpentype:true }) - e.stopPropagation(e);//阻止冒泡 + } hideshowSearchOpen=(e)=>{ + debugger let {setevaluatinghides}=this.state; if(setevaluatinghides===true){ this.setState({ showSearchOpentype:false, setevaluatinghides:false }) - e.stopPropagation(e);//阻止冒泡 + } } @@ -518,6 +520,7 @@ submittojoinclass=(value)=>{ } setevaluatinghides=()=>{ + debugger this.setState( { setevaluatinghides:true @@ -599,6 +602,7 @@ submittojoinclass=(value)=>{ // rolearr:["",""], // console.log("618"); // console.log(user_phone_binded); + console.log(showSearchOpentype) return (
@@ -669,8 +673,21 @@ submittojoinclass=(value)=>{ >工程认证 - -