Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #485 from zaoangod/master
Browse files Browse the repository at this point in the history
🎁修复前端js因数据为空报错
  • Loading branch information
hellokaton authored Nov 18, 2018
2 parents a05bd68 + e0908a8 commit 620770f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ public RestResponse<?> updatePage(@BodyParam Contents contents) {
return RestResponse.ok(cid);
}

@GetRoute("categories")
public RestResponse categories() {
List<Metas> categories = metasService.getMetas(Types.CATEGORY);
return RestResponse.ok(categories);
}

@SysLog("保存分类")
@PostRoute("category/save")
public RestResponse<?> saveCategory(@BodyParam MetaParam metaParam) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/templates/admin/comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ <h3 class="panel-title">评论管理</h3>
},
success: function (data) {
$vm.commentPage = data.payload
if(!data.payload.rows){
$vm.commentPage.rows = []
}
},
error: function (error) {
console.log(error);
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/templates/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ <h4 class="panel-title">系统日志</h4>
tale.get({
url: '/admin/api/comments',
success: function (data) {
$vm.comments = data.payload.rows
if(!data.payload.rows){
$vm.comments = [];
}else{
$vm.comments = data.payload.rows;
}
},
error: function (error) {
console.log(error);
Expand Down

0 comments on commit 620770f

Please sign in to comment.