👽 后台登录保存登录名到cookie

pull/18/head
ruibaby 2018-06-24 12:11:40 +08:00
parent c6a4b2de20
commit 5d46efcbec
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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,