mirror of https://github.com/halo-dev/halo
👽 修改README
parent
9314847c2a
commit
c1770f12a8
|
@ -43,7 +43,7 @@ Let's start: http://localhost:8090
|
|||
|
||||
## Demo 演示
|
||||
|
||||
[界面预览](https://halo-doc.ryanc.cc/preview)
|
||||
[测试地址](http://39.105.26.52),[测试后台(admin,123456)](http://39.105.26.52/admin)
|
||||
|
||||
[Ryan0up'S Blog](https://ryanc.cc)
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package cc.ryanc.halo.model.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : RYAN0UP
|
||||
* @version : 1.0
|
||||
* @date : 2018/5/24
|
||||
*/
|
||||
@Data
|
||||
public class JsonResult {
|
||||
|
||||
/**
|
||||
* 返回的状态码,0:失败,1:成功
|
||||
*/
|
||||
private Integer code;
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回的数据
|
||||
*/
|
||||
private Object result;
|
||||
|
||||
/**
|
||||
* 不返回数据的构造方法
|
||||
* @param code 状态码
|
||||
* @param msg 信息
|
||||
*/
|
||||
public JsonResult(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回数据的构造方法
|
||||
* @param code 状态码
|
||||
* @param msg 信息
|
||||
* @param result 数据
|
||||
*/
|
||||
public JsonResult(Integer code, String msg, Object result) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.result = result;
|
||||
}
|
||||
}
|
|
@ -19,6 +19,8 @@ public interface LogsRecord {
|
|||
|
||||
String PUSH_POST = "发表文章";
|
||||
|
||||
String PUSH_PAGE = "发表页面";
|
||||
|
||||
String REMOVE_POST = "删除文章";
|
||||
|
||||
String CHANGE_THEME = "更换主题";
|
||||
|
|
|
@ -3,6 +3,7 @@ package cc.ryanc.halo.web.controller.admin;
|
|||
import cc.ryanc.halo.model.domain.Attachment;
|
||||
import cc.ryanc.halo.model.domain.Logs;
|
||||
import cc.ryanc.halo.model.dto.HaloConst;
|
||||
import cc.ryanc.halo.model.dto.JsonResult;
|
||||
import cc.ryanc.halo.model.dto.LogsRecord;
|
||||
import cc.ryanc.halo.service.AttachmentService;
|
||||
import cc.ryanc.halo.service.LogsService;
|
||||
|
@ -68,7 +69,6 @@ public class AttachmentController {
|
|||
Pageable pageable = PageRequest.of(page, size, sort);
|
||||
Page<Attachment> attachments = attachmentService.findAllAttachments(pageable);
|
||||
model.addAttribute("attachments", attachments);
|
||||
|
||||
return "admin/admin_attachment";
|
||||
}
|
||||
|
||||
|
@ -216,8 +216,8 @@ public class AttachmentController {
|
|||
*/
|
||||
@GetMapping(value = "/remove")
|
||||
@ResponseBody
|
||||
public boolean removeAttachment(@PathParam("attachId") Long attachId,
|
||||
HttpServletRequest request) {
|
||||
public JsonResult removeAttachment(@PathParam("attachId") Long attachId,
|
||||
HttpServletRequest request) {
|
||||
Optional<Attachment> attachment = attachmentService.findByAttachId(attachId);
|
||||
String delFileName = attachment.get().getAttachName();
|
||||
String delSmallFileName = delFileName.substring(0, delFileName.lastIndexOf('.')) + "_small" + attachment.get().getAttachSuffix();
|
||||
|
@ -249,13 +249,13 @@ public class AttachmentController {
|
|||
);
|
||||
} else {
|
||||
log.error("删除附件[" + delFileName + "]失败!");
|
||||
return false;
|
||||
return new JsonResult(0,"删除失败!");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("删除附件[" + delFileName + "]失败!:", e.getMessage());
|
||||
return false;
|
||||
return new JsonResult(0,"删除失败!");
|
||||
}
|
||||
return true;
|
||||
return new JsonResult(1,"删除成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.model.dto.HaloConst;
|
||||
import cc.ryanc.halo.model.dto.JsonResult;
|
||||
import cc.ryanc.halo.service.OptionsService;
|
||||
import freemarker.template.Configuration;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -45,7 +46,7 @@ public class OptionController {
|
|||
*/
|
||||
@PostMapping(value = "/save")
|
||||
@ResponseBody
|
||||
public boolean saveOptions(@RequestParam Map<String, String> options) {
|
||||
public JsonResult saveOptions(@RequestParam Map<String, String> options) {
|
||||
try {
|
||||
optionsService.saveOptions(options);
|
||||
//刷新options
|
||||
|
@ -53,10 +54,10 @@ public class OptionController {
|
|||
HaloConst.OPTIONS.clear();
|
||||
HaloConst.OPTIONS = optionsService.findAllOptions();
|
||||
log.info("所保存的设置选项列表:" + options);
|
||||
return true;
|
||||
return new JsonResult(1,"保存成功!");
|
||||
} catch (Exception e) {
|
||||
log.error("未知错误:{0}", e.getMessage());
|
||||
return false;
|
||||
return new JsonResult(0,"保存失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,8 +219,16 @@ public class PageController {
|
|||
User user = (User) session.getAttribute(HaloConst.USER_SESSION_KEY);
|
||||
post.setUser(user);
|
||||
post.setPostType(HaloConst.POST_TYPE_PAGE);
|
||||
if(null!=post.getPostId()){
|
||||
post.setPostViews(postService.findByPostId(post.getPostId()).get().getPostViews());
|
||||
post.setPostDate(postService.findByPostId(post.getPostId()).get().getPostDate());
|
||||
post.setPostUpdate(new Date());
|
||||
}else{
|
||||
post.setPostDate(new Date());
|
||||
post.setPostUpdate(new Date());
|
||||
}
|
||||
postService.saveByPost(post);
|
||||
logsService.saveByLogs(new Logs(LogsRecord.PUSH_POST, post.getPostTitle(), HaloUtils.getIpAddr(request), new Date()));
|
||||
logsService.saveByLogs(new Logs(LogsRecord.PUSH_PAGE, post.getPostTitle(), HaloUtils.getIpAddr(request), new Date()));
|
||||
} catch (Exception e) {
|
||||
log.error("未知错误:{0}", e.getMessage());
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package cc.ryanc.halo.web.controller.admin;
|
|||
|
||||
import cc.ryanc.halo.model.domain.Logs;
|
||||
import cc.ryanc.halo.model.dto.HaloConst;
|
||||
import cc.ryanc.halo.model.dto.JsonResult;
|
||||
import cc.ryanc.halo.model.dto.LogsRecord;
|
||||
import cc.ryanc.halo.service.LogsService;
|
||||
import cc.ryanc.halo.service.OptionsService;
|
||||
|
@ -66,8 +67,8 @@ public class ThemeController extends BaseController {
|
|||
*/
|
||||
@GetMapping(value = "/set")
|
||||
@ResponseBody
|
||||
public boolean activeTheme(@PathParam("siteTheme") String siteTheme,
|
||||
HttpServletRequest request) {
|
||||
public JsonResult activeTheme(@PathParam("siteTheme") String siteTheme,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
//保存主题设置项
|
||||
optionsService.saveOption("theme", siteTheme);
|
||||
|
@ -77,10 +78,10 @@ public class ThemeController extends BaseController {
|
|||
logsService.saveByLogs(
|
||||
new Logs(LogsRecord.CHANGE_THEME, "更换为" + siteTheme, HaloUtils.getIpAddr(request), new Date())
|
||||
);
|
||||
return true;
|
||||
return new JsonResult(1,"主题已设置为"+siteTheme);
|
||||
} catch (Exception e) {
|
||||
log.error("主题设置失败,当前主题为:" + siteTheme);
|
||||
return false;
|
||||
return new JsonResult(0,"主题设置失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +94,7 @@ public class ThemeController extends BaseController {
|
|||
*/
|
||||
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public boolean uploadTheme(@RequestParam("file") MultipartFile file,
|
||||
public JsonResult uploadTheme(@RequestParam("file") MultipartFile file,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
if (!file.isEmpty()) {
|
||||
|
@ -109,14 +110,15 @@ public class ThemeController extends BaseController {
|
|||
HaloUtils.removeFile(themePath.getAbsolutePath());
|
||||
HaloConst.THEMES.clear();
|
||||
HaloConst.THEMES = HaloUtils.getThemes();
|
||||
return true;
|
||||
} else {
|
||||
log.error("上传主题失败,没有选择文件");
|
||||
return new JsonResult(0,"请选择上传的主题!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("上传主题失败:{0}", e.getMessage());
|
||||
return new JsonResult(0,"主题上传失败!");
|
||||
}
|
||||
return false;
|
||||
return new JsonResult(1,"主题上传成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -194,10 +196,10 @@ public class ThemeController extends BaseController {
|
|||
*/
|
||||
@PostMapping(value = "/editor/save")
|
||||
@ResponseBody
|
||||
public boolean saveTpl(@RequestParam("tplName") String tplName,
|
||||
public JsonResult saveTpl(@RequestParam("tplName") String tplName,
|
||||
@RequestParam("tplContent") String tplContent) {
|
||||
if (StringUtils.isBlank(tplContent)) {
|
||||
return false;
|
||||
return new JsonResult(0,"模板不能为空!");
|
||||
}
|
||||
try {
|
||||
//获取项目根路径
|
||||
|
@ -207,9 +209,9 @@ public class ThemeController extends BaseController {
|
|||
byte[] tplContentByte = tplContent.getBytes("UTF-8");
|
||||
Files.write(Paths.get(tplPath.getAbsolutePath()), tplContentByte);
|
||||
} catch (Exception e) {
|
||||
log.error("文件保存失败:{0}", e.getMessage());
|
||||
return false;
|
||||
log.error("模板保存失败:{0}", e.getMessage());
|
||||
return new JsonResult(0,"模板保存失败!");
|
||||
}
|
||||
return true;
|
||||
return new JsonResult(1,"模板保存成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.model.domain.User;
|
||||
import cc.ryanc.halo.model.dto.JsonResult;
|
||||
import cc.ryanc.halo.service.UserService;
|
||||
import cc.ryanc.halo.utils.HaloUtils;
|
||||
import freemarker.template.Configuration;
|
||||
|
@ -47,20 +48,20 @@ public class UserController {
|
|||
*/
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public boolean saveProfile(@ModelAttribute User user, HttpSession session) {
|
||||
public JsonResult saveProfile(@ModelAttribute User user, HttpSession session) {
|
||||
try {
|
||||
if (null != user) {
|
||||
userService.saveByUser(user);
|
||||
configuration.setSharedVariable("user", userService.findUser());
|
||||
session.invalidate();
|
||||
} else {
|
||||
return false;
|
||||
return new JsonResult(0,"修改失败!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("未知错误:{0}", e.getMessage());
|
||||
return false;
|
||||
return new JsonResult(0,"修改失败!");
|
||||
}
|
||||
return true;
|
||||
return new JsonResult(1,"修改成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +75,7 @@ public class UserController {
|
|||
*/
|
||||
@PostMapping(value = "changePass")
|
||||
@ResponseBody
|
||||
public boolean changePass(@ModelAttribute("beforePass") String beforePass,
|
||||
public JsonResult changePass(@ModelAttribute("beforePass") String beforePass,
|
||||
@ModelAttribute("newPass") String newPass,
|
||||
@ModelAttribute("userId") Long userId,
|
||||
HttpSession session) {
|
||||
|
@ -85,12 +86,12 @@ public class UserController {
|
|||
userService.saveByUser(user);
|
||||
session.invalidate();
|
||||
} else {
|
||||
return false;
|
||||
return new JsonResult(0,"原密码错误!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("修改密码:未知错误,{0}", e.getMessage());
|
||||
return false;
|
||||
return new JsonResult(0,"密码修改失败!");
|
||||
}
|
||||
return true;
|
||||
return new JsonResult(1,"修改密码成功!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package cc.ryanc.halo.web.controller.front;
|
|||
import cc.ryanc.halo.model.domain.Comment;
|
||||
import cc.ryanc.halo.model.domain.Post;
|
||||
import cc.ryanc.halo.model.dto.HaloConst;
|
||||
import cc.ryanc.halo.model.dto.JsonResult;
|
||||
import cc.ryanc.halo.service.CommentService;
|
||||
import cc.ryanc.halo.service.MailService;
|
||||
import cc.ryanc.halo.service.PostService;
|
||||
|
@ -90,33 +91,37 @@ public class FrontCommentController {
|
|||
*/
|
||||
@PostMapping(value = "/newComment")
|
||||
@ResponseBody
|
||||
public boolean newComment(@ModelAttribute("comment") Comment comment,
|
||||
public JsonResult newComment(@ModelAttribute("comment") Comment comment,
|
||||
@ModelAttribute("post") Post post,
|
||||
HttpServletRequest request) {
|
||||
Comment lastComment = null;
|
||||
post = postService.findByPostId(post.getPostId()).get();
|
||||
comment.setCommentAuthorEmail(comment.getCommentAuthorEmail().toLowerCase());
|
||||
comment.setPost(post);
|
||||
comment.setCommentDate(new Date());
|
||||
comment.setCommentAuthorIp(HaloUtils.getIpAddr(request));
|
||||
comment.setIsAdmin(0);
|
||||
if(comment.getCommentParent()>0){
|
||||
lastComment = commentService.findCommentById(comment.getCommentParent()).get();
|
||||
String lastContent = " //<a href='#comment-id-"+lastComment.getCommentId()+"'>@"+lastComment.getCommentAuthor()+"</a>:"+lastComment.getCommentContent();
|
||||
comment.setCommentContent(StringUtils.substringAfter(comment.getCommentContent(),":")+lastContent);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(comment.getCommentAuthorUrl())){
|
||||
if(!StringUtils.containsAny(comment.getCommentAuthorUrl(),"https://") || !StringUtils.containsAny(comment.getCommentAuthorUrl(),"http://")){
|
||||
comment.setCommentAuthorUrl("http://"+comment.getCommentAuthorUrl());
|
||||
try{
|
||||
Comment lastComment = null;
|
||||
post = postService.findByPostId(post.getPostId()).get();
|
||||
comment.setCommentAuthorEmail(comment.getCommentAuthorEmail().toLowerCase());
|
||||
comment.setPost(post);
|
||||
comment.setCommentDate(new Date());
|
||||
comment.setCommentAuthorIp(HaloUtils.getIpAddr(request));
|
||||
comment.setIsAdmin(0);
|
||||
if(comment.getCommentParent()>0){
|
||||
lastComment = commentService.findCommentById(comment.getCommentParent()).get();
|
||||
String lastContent = " //<a href='#comment-id-"+lastComment.getCommentId()+"'>@"+lastComment.getCommentAuthor()+"</a>:"+lastComment.getCommentContent();
|
||||
comment.setCommentContent(StringUtils.substringAfter(comment.getCommentContent(),":")+lastContent);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(comment.getCommentAuthorUrl())){
|
||||
if(!StringUtils.containsAny(comment.getCommentAuthorUrl(),"https://") || !StringUtils.containsAny(comment.getCommentAuthorUrl(),"http://")){
|
||||
comment.setCommentAuthorUrl("http://"+comment.getCommentAuthorUrl());
|
||||
}
|
||||
}
|
||||
commentService.saveByComment(comment);
|
||||
if(comment.getCommentParent()>0){
|
||||
//new EmailToParent(comment,lastComment,post).start();
|
||||
}else{
|
||||
new EmailToAdmin(comment,post).start();
|
||||
}
|
||||
return new JsonResult(1,"你的评论已经提交,待博主审核之后可显示。");
|
||||
}catch (Exception e){
|
||||
return new JsonResult(0,"评论失败!");
|
||||
}
|
||||
commentService.saveByComment(comment);
|
||||
if(comment.getCommentParent()>0){
|
||||
//new EmailToParent(comment,lastComment,post).start();
|
||||
}else{
|
||||
new EmailToAdmin(comment,post).start();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,8 +44,12 @@ function saveOptions(option) {
|
|||
type: 'post',
|
||||
url: '/admin/option/save',
|
||||
data: param,
|
||||
success: function (result) {
|
||||
showMsg("保存成功!","success",1000);
|
||||
success: function (data) {
|
||||
if(data.code==1){
|
||||
showMsg(data.msg,"success",1000);
|
||||
}else {
|
||||
showMsg(data.msg,"error",1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
|
@ -232,7 +232,11 @@
|
|||
},
|
||||
success: function (data) {
|
||||
$.toast({
|
||||
text: "发布成功!",
|
||||
<#if post??>
|
||||
text: "更新成功!",
|
||||
<#else>
|
||||
text: "发表成功!",
|
||||
</#if>
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
|
|
@ -324,7 +324,11 @@
|
|||
},
|
||||
success: function (data) {
|
||||
$.toast({
|
||||
text: "发布成功!",
|
||||
<#if post??>
|
||||
text: "更新成功!",
|
||||
<#else>
|
||||
text: "发表成功!",
|
||||
</#if>
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
|
|
@ -155,10 +155,10 @@
|
|||
type: 'post',
|
||||
url: '/admin/profile/save',
|
||||
data: param,
|
||||
success: function (result) {
|
||||
if(result==true){
|
||||
success: function (data) {
|
||||
if(data.code==1){
|
||||
$.toast({
|
||||
text: "保存成功!",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
@ -174,7 +174,7 @@
|
|||
}
|
||||
});
|
||||
}else{
|
||||
showMsg("保存失败!","error",2000);
|
||||
showMsg(data.msg,"error",2000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -196,10 +196,10 @@
|
|||
type: 'post',
|
||||
url: '/admin/profile/changePass',
|
||||
data: param,
|
||||
success: function (result) {
|
||||
if(result==true){
|
||||
success: function (data) {
|
||||
if(data.code==1){
|
||||
$.toast({
|
||||
text: "修改密码成功!",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
@ -215,7 +215,7 @@
|
|||
}
|
||||
});
|
||||
}else{
|
||||
showMsg("原密码错误!","error",2000);
|
||||
showMsg(data.msg,"error",2000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -127,9 +127,9 @@
|
|||
'tplContent': editor.getValue()
|
||||
},
|
||||
success: function (data) {
|
||||
if(data==true){
|
||||
if(data.code==1){
|
||||
$.toast({
|
||||
text: "保存成功!",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
@ -143,7 +143,7 @@
|
|||
});
|
||||
}else{
|
||||
$.toast({
|
||||
text: "保存失败!",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'error',
|
||||
showHideTransition: 'fade',
|
||||
|
|
|
@ -146,11 +146,10 @@
|
|||
dropZoneTitle: '拖拽主题压缩包到这里 …<br>不支持多个主题同时上传',
|
||||
showClose: false
|
||||
}).on("fileuploaded",function (event,data,previewId,index) {
|
||||
var data = data.jqXHR.responseJSON;
|
||||
if(data==true){
|
||||
if(data.code==1){
|
||||
$("#uploadForm").hide(400);
|
||||
$.toast({
|
||||
text: "上传成功!",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
@ -165,6 +164,20 @@
|
|||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.toast({
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'error',
|
||||
showHideTransition: 'fade',
|
||||
allowToastClose: true,
|
||||
hideAfter: 1000,
|
||||
stack: 1,
|
||||
position: 'top-center',
|
||||
textAlign: 'left',
|
||||
loader: true,
|
||||
loaderBg: '#ffffff'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -189,11 +202,11 @@
|
|||
'siteTheme': site_theme
|
||||
},
|
||||
success: function (data) {
|
||||
if(data==true){
|
||||
if(data.code==1){
|
||||
$.toast({
|
||||
text: "设置中...",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'info',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
allowToastClose: true,
|
||||
hideAfter: 1000,
|
||||
|
@ -206,6 +219,20 @@
|
|||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.toast({
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'error',
|
||||
showHideTransition: 'fade',
|
||||
allowToastClose: true,
|
||||
hideAfter: 2000,
|
||||
stack: 1,
|
||||
position: 'top-center',
|
||||
textAlign: 'left',
|
||||
loader: true,
|
||||
loaderBg: '#ffffff'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -94,9 +94,9 @@
|
|||
attachId : ${attachment.attachId?c}
|
||||
},
|
||||
success: function (data) {
|
||||
if(data==true){
|
||||
if(data.code==1){
|
||||
$.toast({
|
||||
text: "删除成功!",
|
||||
text: data.msg,
|
||||
heading: '提示',
|
||||
icon: 'success',
|
||||
showHideTransition: 'fade',
|
||||
|
@ -112,7 +112,7 @@
|
|||
}
|
||||
});
|
||||
}else{
|
||||
showMsg("删除失败","error",2000);
|
||||
showMsg(data.msg,"error",2000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -284,13 +284,14 @@
|
|||
'commentParent': $('input[name=commentParent]').val()
|
||||
},
|
||||
success: function (data) {
|
||||
if (data == true) {
|
||||
$(".native-message").html("<span>你的评论已经提交,待博主审核之后可显示。</span>");
|
||||
$(".native-message").fadeIn(1000);
|
||||
setTimeout(function () {
|
||||
window.location.reload();
|
||||
},1500);
|
||||
if(data.code==1){
|
||||
$('.comment-input-content').val("");
|
||||
}
|
||||
$(".native-message").html("<span>"+data.msg+"</span>");
|
||||
$(".native-message").fadeIn(1000);
|
||||
setTimeout(function () {
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -214,7 +214,11 @@
|
|||
url: '/admin/option/save',
|
||||
data: param,
|
||||
success: function (data) {
|
||||
showMsg("保存成功!","success",1000);
|
||||
if(data.code==1){
|
||||
showMsg(data.msg,"success",1000);
|
||||
}else{
|
||||
showMsg(data.msg,"error",1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -543,7 +543,11 @@
|
|||
url: '/admin/option/save',
|
||||
data: param,
|
||||
success: function (data) {
|
||||
showMsg("保存成功!","success",1000);
|
||||
if(data.code==1){
|
||||
showMsg(data.msg,"success",1000);
|
||||
}else{
|
||||
showMsg(data.msg,"error",1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue