Files
ClassContent/历届学生/17届课程/blog/dist/public/js/admin/push.js
2024-09-27 02:06:13 +08:00

31 lines
818 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var E = window.wangEditor
var editor = new E('#editor')
editor.create()
$(".pushArticel").click(function() {
var title = $(".title").val()
var introduction = $(".introduction").val()
var author = $(".author").val()
var content = editor.txt.html()
// 验证用户是否输入内容,有没填写的给提示
// 对push接口实现token验证的调用
// 登录成功本地保存 token发送ajax请求头携带token
//
$.ajax({
url: 'http://127.0.0.1:3000/admin/api/push',
type: 'POST',
data: {
title: title,
introduction: introduction,
author: author,
content: content
},
success: function(res) {
console.log(res);
},
error: function(err) {}
})
});