Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eb4ca5a

Browse files
fix userlist null list
1 parent fe28d00 commit eb4ca5a

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

‎src/main/java/cn/netbuffer/jfinal_bootstrap_table/controller/UserController.java‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.jfinal.core.Controller;
1010
import com.jfinal.plugin.ehcache.CacheInterceptor;
1111
import lombok.extern.slf4j.Slf4j;
12+
import java.util.HashMap;
1213
import java.util.Map;
1314

1415
/**
@@ -34,12 +35,24 @@ public void userlist() {
3435
int limit = getParaToInt("limit");
3536
int offset = getParaToInt("offset");
3637
Map<String, Object> data = userservice.getUserList(offset, limit);
38+
if (data == null) {
39+
Map<String, Object> datas = new HashMap<String, Object>(2);
40+
datas.put("rows", null);
41+
datas.put("total", 0);
42+
data = datas;
43+
}
3744
renderJson(data);
3845
}
3946

4047
public void delete() {
41-
User.dao.deleteById(getPara("id"));
42-
setAttr("status", "success");
48+
String id = getPara("id");
49+
boolean del = User.dao.deleteById(id);
50+
log.debug("删除用户:{},结果:{}", id, del);
51+
if (del) {
52+
setAttr("status", "success");
53+
} else {
54+
setAttr("status", "false");
55+
}
4356
renderJson();
4457
}
4558

‎src/main/webapp/manage.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
data-toggle="dropdown" role="button" aria-haspopup="true"
3030
aria-expanded="false">测试连接 <span class="caret"></span></a>
3131
<ul class="dropdown-menu">
32-
<li><a href="sleep">sleep</a></li>
33-
<li><a href="#">Another action</a></li>
32+
<li><a href="sleep"target="_blank">sleep test</a></li>
33+
<li><a href="register" target="_blank">register</a></li>
3434
<li><a href="#">Something else here</a></li>
3535
<li role="separator" class="divider"></li>
3636
<li><a href="#">Separated link</a></li>

‎src/main/webapp/oldindex.html‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /