From 51e215f425f7992453796ec311692a1f71595cef Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 16:52:29 +0800 Subject: [PATCH 1/8] html --- public/react/src/common/TextUtil.js | 40 ++++++++++++++++------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 70ca23258..05299467b 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,26 +6,30 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html - try { - var markdwonParser = window.editormd.markdownToHTML("md_div", { - markdown: oldContent, // .replace(/▁/g,"▁▁▁"), - emoji: true, - htmlDecode: "style,script,iframe", // you can filter tags decode - taskList: true, - tex: true, // 默认不解析 - flowChart: true, // 默认不解析 - sequenceDiagram: true // 默认不解析 - }); + if (selector && oldContent && oldContent.startsWith('
')) { // 普通html处理 + window.$(selector).html(oldContent) + } else { + try { + var markdwonParser = window.editormd.markdownToHTML("md_div", { + markdown: oldContent, // .replace(/▁/g,"▁▁▁"), + emoji: true, + htmlDecode: "style,script,iframe", // you can filter tags decode + taskList: true, + tex: true, // 默认不解析 + flowChart: true, // 默认不解析 + sequenceDiagram: true // 默认不解析 + }); - } catch(e) { - console.error(e) + } catch(e) { + console.error(e) + } + + const content = window.$('#md_div').html() + if (selector) { + window.$(selector).html(content) + } + return content } - - const content = window.$('#md_div').html() - if (selector) { - window.$(selector).html(content) - } - return content } export function appendFileSizeToUploadFile(item) { From bcfe17712f2fd626b5ccdbda1e8a5e62947e42bb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 16:54:18 +0800 Subject: [PATCH 2/8] selector --- public/react/src/modules/courses/busyWork/CommonWorkQuestion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js index 7932311b1..49f1e5158 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js @@ -87,7 +87,7 @@ class CommonWorkQuestion extends Component{ {/* 内容区 */}
')) { // 普通html处理 + if (selector && oldContent && oldContent.startsWith('
Date: Fri, 26 Jul 2019 17:54:58 +0800
Subject: [PATCH 8/8] =?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/login/LoginDialog.js | 30 +++++++++++++++----
.../modules/user/LoginRegisterComponent.js | 4 +--
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js
index d3df6090e..a4dee4b4c 100644
--- a/public/react/src/modules/login/LoginDialog.js
+++ b/public/react/src/modules/login/LoginDialog.js
@@ -13,6 +13,7 @@ import axios from 'axios';
import './LoginDialog.css';
import { broadcastChannelPostMessage } from 'educoder'
+import Notcompletedysl from "../user/Notcompletedysl";
const $ = window.$;
var wait = 60;
@@ -100,6 +101,7 @@ class LoginDialog extends Component {
authCodeType:true,
authCodeclass:'log-botton mt5',
isRender: false,
+ MyEduCoderModals:false,
};
}
@@ -365,11 +367,12 @@ class LoginDialog extends Component {
description:response.data.message,
});
}else{
- if(response.data.identity === null || response.data.identity === undefined){
- this.props.history.push("/interesse");
+ if(response.data.profile_completed !== null || response.data.profile_completed === false){
+ this.setMyEduCoderModals();
return;
}
- broadcastChannelPostMessage('refreshPage')
+
+ broadcastChannelPostMessage('refreshPage')
this.setState({
isRender:false
})
@@ -388,17 +391,28 @@ class LoginDialog extends Component {
console.log(error)
})
- }
+ };
+ setNotcompleteds=()=>{
+ this.setState({
+ Notcompleteds:true,
+ MyEduCoderModals:false
+ })
+ };
+ setMyEduCoderModals=()=>{
+ this.setState({
+ MyEduCoderModals:true
+ })
+ };
onKeydowns=(e)=>{
let {disabled}=this.state;
if( disabled===false&& e.keyCode === 13){
this.loginEDU()
console.log(1)
}
- }
+ };
getloginurl=(url)=>{
window.location.href = url;
- }
+ };
render() {
let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state;
@@ -414,6 +428,10 @@ class LoginDialog extends Component {
disableBackdropClick={true}
onClose={() => this.handleDialogClose()}
>
+