Skip to content

Commit

Permalink
修复前端js因数据为空报错
Browse files Browse the repository at this point in the history
  • Loading branch information
zaoangod committed Nov 6, 2018
1 parent a05bd68 commit f05ed3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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 f05ed3b

Please sign in to comment.