Commit ab0f4d0d authored by daniel's avatar daniel

Update news.js 新增外链

parent 09b51f22
......@@ -8,6 +8,7 @@ $(document).ready(function () {
layer.alert("标题不能为空!");
return;
}
let linkUrl = $('#linkUrl').val();
var content = editor.getContent();
if (!content) {
layer.alert("内容不能为空!");
......@@ -17,6 +18,7 @@ $(document).ready(function () {
url: "/gk/news/save",
type: 'post',
data: {
linkUrl,
id: $('.edit-container').attr('data-id'), title: title, content: editor.getContent(), userId: 1,
cmptId: getCId(), cover: $('#file-cover').attr('data-src'), type: $('input[name="type"]:checked').val()
},
......@@ -163,6 +165,7 @@ function getNews(id) {
success: function (data) {
if (data.code == 200) {
$('#title').val(data.content.title)
$('#linkUrl').val(data.content.linkUrl)
$('input[name="type"][value=' + data.content.type + ']').attr('checked', true)
if (data.content.cover) {
$('.cover').css('background-image', "url(" + data.content.cover + ")")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment