Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
git test
Halo
Commits
c1770f12
Commit
c1770f12
authored
7 years ago
by
ruibaby
Browse files
Options
Download
Email Patches
Plain Diff
修改README
parent
9314847c
master
next
release-1.4
release-1.5
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.5.0-beta.1
v1.5.0-alpha.3
v1.5.0-alpha.2
v1.5.0-alpha.1
v1.4.17
v1.4.16
v1.4.15
v1.4.14
v1.4.13
v1.4.12
v1.4.11
v1.4.10
v1.4.9
v1.4.8
v1.4.7
v1.4.7-beta.1
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.3-beta.3
v1.4.3-beta.2
v1.4.3-beta.1
v1.4.2
v1.4.1
v1.4.0
v1.4.0-beta.3
v1.4.0-beta.2
v1.4.0-beta.1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-beta.4
v1.3.0-beta.3
v1.3.0-beta.2
v1.3.0-beta.1
v1.2.0
v1.2.0-beta.5
v1.2.0-beta.4
v1.2.0-beta.3
v1.2.0-beta.2
v1.2.0-beta.1
v1.1.3-beta.2
v1.1.3-beta.1
v1.1.1
v1.1.0
v1.1.0-beta.3
v1.1.0-beta.2
v1.1.0-beta.1
v1.0.3
v1.0.2
v1.0.2-beta.1
v1.0.1
v1.0.0
v1.0.0-beta.9
v1.0.0-beta.8
v1.0.0-beta.7
v1.0.0-beta.6
v1.0.0-beta.5
v1.0.0-beta.4
v1.0.0-beta.3
v1.0.0-beta.2
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1
v0.0.9
v0.0.8
v0.0.7
v0.0.6
v0.0.5
v0.0.4
No related merge requests found
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
README.md
+1
-1
README.md
src/main/java/cc/ryanc/halo/model/dto/JsonResult.java
+49
-0
src/main/java/cc/ryanc/halo/model/dto/JsonResult.java
src/main/java/cc/ryanc/halo/model/dto/LogsRecord.java
+2
-0
src/main/java/cc/ryanc/halo/model/dto/LogsRecord.java
src/main/java/cc/ryanc/halo/web/controller/admin/AttachmentController.java
+6
-6
...ryanc/halo/web/controller/admin/AttachmentController.java
src/main/java/cc/ryanc/halo/web/controller/admin/OptionController.java
+4
-3
.../cc/ryanc/halo/web/controller/admin/OptionController.java
src/main/java/cc/ryanc/halo/web/controller/admin/PageController.java
+9
-1
...va/cc/ryanc/halo/web/controller/admin/PageController.java
src/main/java/cc/ryanc/halo/web/controller/admin/ThemeController.java
+14
-12
...a/cc/ryanc/halo/web/controller/admin/ThemeController.java
src/main/java/cc/ryanc/halo/web/controller/admin/UserController.java
+9
-8
...va/cc/ryanc/halo/web/controller/admin/UserController.java
src/main/java/cc/ryanc/halo/web/controller/front/FrontCommentController.java
+28
-23
...anc/halo/web/controller/front/FrontCommentController.java
src/main/resources/static/js/app.js
+6
-2
src/main/resources/static/js/app.js
src/main/resources/templates/admin/admin_page_md_editor.ftl
+5
-1
src/main/resources/templates/admin/admin_page_md_editor.ftl
src/main/resources/templates/admin/admin_post_md_editor.ftl
+5
-1
src/main/resources/templates/admin/admin_post_md_editor.ftl
src/main/resources/templates/admin/admin_profile.ftl
+8
-8
src/main/resources/templates/admin/admin_profile.ftl
src/main/resources/templates/admin/admin_theme-editor.ftl
+3
-3
src/main/resources/templates/admin/admin_theme-editor.ftl
src/main/resources/templates/admin/admin_theme.ftl
+33
-6
src/main/resources/templates/admin/admin_theme.ftl
src/main/resources/templates/admin/widget/_attachment-detail.ftl
+3
-3
...n/resources/templates/admin/widget/_attachment-detail.ftl
src/main/resources/templates/common/comment/_native_comment.ftl
+7
-6
...in/resources/templates/common/comment/_native_comment.ftl
src/main/resources/templates/themes/anatole/module/options.ftl
+5
-1
...ain/resources/templates/themes/anatole/module/options.ftl
src/main/resources/templates/themes/material/module/options.ftl
+5
-1
...in/resources/templates/themes/material/module/options.ftl
with
202 additions
and
86 deletions
+202
-86
README.md
+
1
-
1
View file @
c1770f12
...
...
@@ -43,7 +43,7 @@ Let's start: http://localhost:8090
## Demo 演示
[
界面预览
](
http
s
://
halo-doc.ryanc.cc/preview
)
[
测试地址
](
http://
39.105.26.52
)
,
[
测试后台(admin,123456)
](
http://39.105.26.52/admin
)
[
Ryan0up'S Blog
](
https://ryanc.cc
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/model/dto/JsonResult.java
0 → 100644
+
49
-
0
View file @
c1770f12
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
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/model/dto/LogsRecord.java
+
2
-
0
View file @
c1770f12
...
...
@@ -19,6 +19,8 @@ public interface LogsRecord {
String
PUSH_POST
=
"发表文章"
;
String
PUSH_PAGE
=
"发表页面"
;
String
REMOVE_POST
=
"删除文章"
;
String
CHANGE_THEME
=
"更换主题"
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/web/controller/admin/AttachmentController.java
+
6
-
6
View file @
c1770f12
...
...
@@ -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
,
"删除成功!"
)
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/web/controller/admin/OptionController.java
+
4
-
3
View file @
c1770f12
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
,
"保存失败!"
)
;
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/web/controller/admin/PageController.java
+
9
-
1
View file @
c1770f12
...
...
@@ -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_P
OST
,
post
.
getPostTitle
(),
HaloUtils
.
getIpAddr
(
request
),
new
Date
()));
logsService
.
saveByLogs
(
new
Logs
(
LogsRecord
.
PUSH_P
AGE
,
post
.
getPostTitle
(),
HaloUtils
.
getIpAddr
(
request
),
new
Date
()));
}
catch
(
Exception
e
)
{
log
.
error
(
"未知错误:{0}"
,
e
.
getMessage
());
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/web/controller/admin/ThemeController.java
+
14
-
12
View file @
c1770f12
...
...
@@ -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
,
"模板保存成功!"
)
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/web/controller/admin/UserController.java
+
9
-
8
View file @
c1770f12
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
,
"修改密码成功!"
)
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cc/ryanc/halo/web/controller/front/FrontCommentController.java
+
28
-
23
View file @
c1770f12
...
...
@@ -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
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/static/js/app.js
+
6
-
2
View file @
c1770f12
...
...
@@ -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
);
}
}
});
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/templates/admin/admin_page_md_editor.ftl
+
5
-
1
View file @
c1770f12
...
...
@@ -232,7 +232,11 @@
},
success
:
function
(
data
)
{
$
.toast
({
text
:
"发布成功!"
,
<#
if
post
??>
text
:
"更新成功!"
,
<#
else
>
text
:
"发表成功!"
,
</#
if
>
heading
:
'提示'
,
icon
:
'
success
'
,
showHideTransition
:
'
fade
'
,
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/admin/admin_post_md_editor.ftl
+
5
-
1
View file @
c1770f12
...
...
@@ -324,7 +324,11 @@
},
success
:
function
(
data
)
{
$
.toast
({
text
:
"发布成功!"
,
<#
if
post
??>
text
:
"更新成功!"
,
<#
else
>
text
:
"发表成功!"
,
</#
if
>
heading
:
'提示'
,
icon
:
'
success
'
,
showHideTransition
:
'
fade
'
,
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/admin/admin_profile.ftl
+
8
-
8
View file @
c1770f12
...
...
@@ -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
)
;
}
}
})
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/admin/admin_theme-editor.ftl
+
3
-
3
View file @
c1770f12
...
...
@@ -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
'
,
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/admin/admin_theme.ftl
+
33
-
6
View file @
c1770f12
...
...
@@ -146,11 +146,10 @@
dropZoneTitle
:
'拖拽主题压缩包到这里
&
hellip
;<
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
'
})
;
}
}
})
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/admin/widget/_attachment-detail.ftl
+
3
-
3
View file @
c1770f12
...
...
@@ -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
)
;
}
}
})
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/common/comment/_native_comment.ftl
+
7
-
6
View file @
c1770f12
...
...
@@ -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
)
;
}
})
;
}
);
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/themes/anatole/module/options.ftl
+
5
-
1
View file @
c1770f12
...
...
@@ -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
)
;
}
}
})
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/themes/material/module/options.ftl
+
5
-
1
View file @
c1770f12
...
...
@@ -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
)
;
}
}
})
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help