From e77ad0d04db7e95201a20a219e9786a2d5e05dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 24 Jul 2019 14:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 7 +++---- public/react/src/modules/courses/new/CoursesNew.js | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 02d8c2be5..0666aadc3 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -18,10 +18,9 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType ="" -// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' -// 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 diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 1183b59e9..eb52a32f5 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -135,6 +135,8 @@ class CoursesNew extends Component { let {is_public,datatime} = this.state // console.log(is_public) + debugger + if (coursesId != undefined) { // 编辑 @@ -180,7 +182,7 @@ class CoursesNew extends Component { name: values.classroom, class_period: values.period, credit: parseFloat(values.credit), - end_date: datatime, + end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, authentication: this.state.Realnamecertification, @@ -234,7 +236,7 @@ class CoursesNew extends Component { name: values.classroom, class_period: values.period, credit: parseFloat(values.credit), - end_date: datatime, + end_date: datatime===undefined?"":datatime, is_public: is_public === true || is_public === 1 ? 1 : 0, course_module_types: values.checkboxgroup, authentication: this.state.Realnamecertification,