From b45fea069be4e017c1456c8bfad3212316dbc351 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 4 Sep 2019 15:13:57 +0800 Subject: [PATCH 1/4] isMobile --- public/react/src/common/Env.js | 5 ++++- public/react/src/common/educoder.js | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/src/common/Env.js b/public/react/src/common/Env.js index bdd4584f4..2d226ab22 100644 --- a/public/react/src/common/Env.js +++ b/public/react/src/common/Env.js @@ -1,3 +1,6 @@ export function isDev() { return window.location.port === "3007"; -} \ No newline at end of file +} + +const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); +export const isMobile \ No newline at end of file diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 1d7c66dbb..5b1d7ac28 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -20,8 +20,7 @@ export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, ap downloadFile, sortDirections } from './TextUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' - -export { isDev as isDev } from './Env' +export { isDev as isDev, isMobile } from './Env' export { toStore as toStore, fromStore as fromStore } from './Store' From 706028bc57230f51add0467125154afb941d7077 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 4 Sep 2019 15:16:13 +0800 Subject: [PATCH 2/4] isMobile --- public/react/src/common/Env.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/common/Env.js b/public/react/src/common/Env.js index 2d226ab22..283e82c48 100644 --- a/public/react/src/common/Env.js +++ b/public/react/src/common/Env.js @@ -2,5 +2,5 @@ export function isDev() { return window.location.port === "3007"; } -const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); -export const isMobile \ No newline at end of file +// const isMobile +export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); \ No newline at end of file From 6806e45fcc72792dcf7efe42b89f99c6e87cece5 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, 4 Sep 2019 15:19:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=B7=B2=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E5=AD=A6=E7=94=9F=E9=80=80=E5=87=BA=E8=AF=BE=E5=A0=82?= =?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/modules/courses/coursesDetail/CoursesBanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index d8927b8d7..15f57f130 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -625,7 +625,7 @@ class CoursesBanner extends Component { ) : ""} - {this.props.isStudent()? this.exitclass()} > 退出课堂 :""} From 83986eed6da435549f03c21da4e6b04b13a207ff Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 4 Sep 2019 15:20:53 +0800 Subject: [PATCH 4/4] encode --- .../src/modules/courses/members/modal/AddStudentModal.js | 2 +- public/react/src/modules/courses/members/teacherList.js | 2 +- .../src/modules/paths/PathDetail/DetailCardsEditAndAdd.js | 4 ++-- public/react/src/modules/tpm/TPMBanner.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js index de95bc741..cf7583a51 100644 --- a/public/react/src/modules/courses/members/modal/AddStudentModal.js +++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js @@ -29,7 +29,7 @@ class AddStudentModal extends Component{ const { name, school_name } = this.state let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${school_name || ''}&name=${name || ''}` this.setState({ loading: true }) - axios.get(url) + axios.get(encodeURI(url)) .then((response) => { if (!response.data.users || response.data.users.length == 0) { this.setState({ diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index ee1f1dacb..70b1e3bd6 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -377,7 +377,7 @@ class studentsList extends Component{ if(searchValue!=""){ url+='&search='+searchValue; } - const result = await axios.get(url) + const result = await axios.get(encodeURI(url)) // axios.get((url)).then((result)=>{ if (result.data.teacher_list) { this.setState({ diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index d1bf6e1f0..f3c9d514b 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -160,7 +160,7 @@ class DetailCardsEditAndAdd extends Component{ url+="&type="+id; } - axios.get(url).then((result)=>{ + axios.get(encodeURI(url)).then((result)=>{ if(result.status===200){ this.setState({ ChooseShixunList:result.data, @@ -322,7 +322,7 @@ class DetailCardsEditAndAdd extends Component{ if(type!=0){ url+="&type="+type; } - axios.get(url).then((result)=>{ + axios.get(encodeURI(url)).then((result)=>{ if(result.status===200){ let list =result.data.shixun_list; diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 0009e1f98..997786db2 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -205,7 +205,7 @@ class TPMBanner extends Component { SenttotheSearch=(value)=>{ let id = this.props.match.params.shixunId; let url="/shixuns/" + id +"/search_user_courses.json?search="+value; - axios.get(url, { + axios.get(encodeURI(url), { params: { page:1, limit:10