From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 02 八月 2022 11:42:43 +0800 Subject: [PATCH] Merge branch 'develop' --- src/components/editor/index.jsx | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index 2c0bd2b..dae66f6 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -23,8 +23,8 @@ class NormalEditor extends Component { static propTpyes = { - Item: PropTypes.object, // 琛ㄥ崟鍏冪礌 - onChange: PropTypes.func, // 琛ㄥ崟鏇存柊 + config: PropTypes.object, + onChange: PropTypes.func } state = { @@ -33,19 +33,22 @@ } UNSAFE_componentWillMount () { + const { config, defaultValue } = this.props let initVal = null let encryption = 'false' - if (this.props['data-__meta']) { - initVal = this.props['data-__meta'].initialValue || null + if (config && config.initval) { + initVal = config.initval + } else if (defaultValue) { + initVal = defaultValue } - if (this.props.Item && this.props.Item.encryption === 'true') { + if (config && config.encryption === 'true') { encryption = 'true' if (initVal) { try { initVal = window.decodeURIComponent(window.atob(initVal)) - } catch { + } catch (e) { initVal = this.props['data-__meta'].initialValue || null } } @@ -69,7 +72,7 @@ if (encryption === 'true') { try { val = window.btoa(window.encodeURIComponent(val)) - } catch { + } catch (e) { val = editorState.toHTML() } } @@ -90,6 +93,8 @@ form.append('fileExt', params.file.fileType) form.append('shardingCnt', _param.chunks) form.append('shardingNo', _param.chunk) + form.append('LoginUID', sessionStorage.getItem('LoginUID') || '') + form.append('UserID', sessionStorage.getItem('UserID') || '') Api.getLargeFileUpload(form).then(res => { if (res.status) { -- Gitblit v1.8.0