Commit 62957687 by chent

修改登录报错问题

parent 625a7a20
......@@ -35,6 +35,9 @@ public class UserServiceImpl implements UserService {
public XzxtRestResult login(String username, String password) {
//XzxtRestResult xzxtRestResult=new XzxtRestResult();
User user=userMapper.login(username);
if(user==null){
return XzxtRestResult.build(202,"用户不存在");
}else{
if (user.getPassword().equals(password)&&user.getStatus() == 0) {
// 因为缓存切面的原因,在这里就抛出用户名不存在的异常
return XzxtRestResult.build(201,"登陆成功");
......@@ -43,6 +46,8 @@ public class UserServiceImpl implements UserService {
return XzxtRestResult.build(202,"登陆密码错误或者用户被锁定");
}
}
}
@Override
public ResultMap userAll(User user) {
List<User> userlist=userMapper.selectPageList(user);
......
......@@ -32,7 +32,7 @@
<div class="layui-form-item">
<label class="layui-form-label login-form"><i class="iconfont">&#xe82b;</i></label>
<div class="layui-input-inline login-inline">
<input type="text" name="password" lay-verify="required" placeholder="请输入你的密码" autocomplete="off" class="layui-input">
<input type="password" name="password" lay-verify="required" placeholder="请输入你的密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="form-actions">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment