mirror of https://github.com/halo-dev/halo
👽 后台登录保存登录名到cookie
parent
c6a4b2de20
commit
5d46efcbec
|
@ -157,10 +157,6 @@ public class PostController extends BaseController {
|
|||
public JsonResult pushPost(@ModelAttribute Post post, @RequestParam("cateList") List<String> cateList, @RequestParam("tagList") String tagList, HttpSession session) {
|
||||
User user = (User) session.getAttribute(HaloConst.USER_SESSION_KEY);
|
||||
String msg = "发表成功";
|
||||
//判断文章路径是否已经存在
|
||||
if (null != postService.findByPostUrl(post.getPostUrl(), HaloConst.POST_TYPE_POST)) {
|
||||
return new JsonResult(0, "该文章路径已存在!");
|
||||
}
|
||||
try {
|
||||
//提取摘要
|
||||
int postSummary = 50;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
$(document).ready(function () {
|
||||
$("#login-name").val(localStorage.getItem("loginName"));
|
||||
});
|
||||
function btn_login() {
|
||||
$('#btn-login').button('loading');
|
||||
var name = $("#login-name").val();
|
||||
|
@ -15,6 +18,7 @@ function btn_login() {
|
|||
'loginPwd': pwd
|
||||
},
|
||||
success: function (data) {
|
||||
localStorage.setItem('loginName', $("#login-name").val());
|
||||
if(data.code==1){
|
||||
$.toast({
|
||||
text: data.msg,
|
||||
|
@ -60,4 +64,4 @@ $(document).keydown(function (event) {
|
|||
if(event.keyCode == 13){
|
||||
btn_login();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue