Skip to content

Commit 11dda82

Browse files
committed
拦截一下空字符串
1 parent 7ca45fb commit 11dda82

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

web/src/main/java/info/xiaomo/web/controller/UserController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public HashMap<String, Object> login(@RequestParam String email, @RequestParam S
9393
public HashMap<String, Object> register(
9494
@RequestParam String email
9595
) throws Exception {
96+
if (email.equals("")) {
97+
return null;
98+
}
9699
UserModel userModel = service.findUserByEmail(email);
97100
//邮箱被占用
98101
if (userModel != null) {

web/src/main/resources/public/update.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
$("#nickName").val(data.user.nickName);
1919
$("#img").attr("src",data.user.imgUrl);
2020
$("#email").val(data.user.email);
21+
$("#password").val(data.user.password);
2122
$("#gender").val(data.user.gender);
2223
$("#phone").val(data.user.phone);
2324
$("#address").val(data.user.address);
@@ -30,7 +31,7 @@
3031
</script>
3132
</head>
3233
<body>
33-
<form action="/web/user/update" method="post" enctype="multipart/form-data">
34+
<form action="http://api.xiaomo.info:8888/web/user/update" method="post" enctype="multipart/form-data">
3435
<div class="container">
3536
<div class="panel panel-default">
3637
<div class="panel-heading">
@@ -47,6 +48,12 @@ <h3 class="panel-title center">Panel title</h3>
4748
<input type="file" name="imgUrl" id="imgUrl" alt="" title=""><br>
4849
</div>
4950
</div>
51+
<div class="row">
52+
<div class="col-md-2">密码</div>
53+
<div class="col-md-2">
54+
<input type="password" name="password" id="password" alt="" title=""><br>
55+
</div>
56+
</div>
5057
<div class="row">
5158
<div class="col-md-2">昵称</div>
5259
<div class="col-md-2">

0 commit comments

Comments
 (0)