WIN-2308041133\Administrator 4 months ago
parent
commit
51c0c7cffd

+ 2 - 13
app/admin/view/article/article/create.php

@@ -97,10 +97,7 @@
                <div class="form-group">
                    <div class="col-md-12">
                        <label style="color:#aaa">文章内容</label>
-<!--                       <textarea type="text/plain" id="myEditor" style="width:100%;">{$news['content']}</textarea>-->
-                       <textarea type="text/plain" id="myEditor" style="width:100%;">
-    {php}echo htmlspecialchars_decode($news['content'], ENT_QUOTES | ENT_HTML5);{/php}
-</textarea>
+                       <textarea type="text/plain" id="myEditor" style="width:100%;">{$news['content']}</textarea>
                    </div>
                </div>
                <div class="form-group">
@@ -234,15 +231,7 @@
                 list.title = $('#title').val();/* 标题 */
                 list.author = $('#author').val();/* 作者 */
                 list.image_input = $('#image_input').val();/* 图片 */
-                // list.content = getContent();/* 内容 */
-                list.content = UM.getEditor('myEditor').body.innerHTML;
-                // list.content = list.content
-                //     .replace(/\\"/g, '"')
-                //     .replace(/\\\//g, '/')
-                //     .replace(/\\'/g, "'")
-                //     .replace(/\\\\/g, "\\")
-                //     .replace(/&quot;/g, '"')
-                //     .replace(/&amp;/g, '&');
+                list.content = getContent();/* 内容 */
                 list.synopsis = $('#synopsis').val();/* 简介 */
                 list.url = $('#url').val();/* 原文链接 */
                 list.id = $('#id').val();/* 原文链接 */

+ 1 - 1
app/models/article/Article.php

@@ -56,7 +56,7 @@ class Article extends BaseModel
             $list->store_info = $list->profile ? $list->profile->toArray() : null;
             $list = $list->hidden(['hide', 'status', 'admin_id', 'mer_id'])->toArray();
             $list["content"] = Db::name('articleContent')->where('nid', $id)->value('content');
-            $list["content"] = htmlspecialchars_decode($list["content"]);
+//            $list["content"] = htmlspecialchars_decode($list["content"]);
             return $list;
         } else return [];
     }

+ 2 - 7
public/system/plug/umeditor/umeditor.config.js

@@ -153,12 +153,8 @@ etpl.config({
             '| justifyleft justifycenter justifyright justifyjustify |',
             'link unlink | emotion image video  | map',
             '| horizontal print preview fullscreen', 'drafts', 'formula'
-        ],
-        escape: false,  // 关闭自动转义 ★核心
-        allowDivTransToP: false,
-        autoClearinitialContent: true,
-        // 新增配置:禁用自动转换引号
-        autoTransWord: false
+        ]
+
         //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
         //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
         //,lang:"zh-cn"
@@ -330,5 +326,4 @@ etpl.config({
 			video:  ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'style', 'class', 'id']
         }
     };
-    var um = UM.getEditor('myEditor');
 })();