|
@@ -50,13 +50,15 @@ public class MobileUserServiceImpl implements MobileUserService {
|
|
|
|
|
|
Map endMap = new HashMap();
|
|
Map endMap = new HashMap();
|
|
Integer grant = mobileUser.getGrantClass();
|
|
Integer grant = mobileUser.getGrantClass();
|
|
- if (grant != 3){
|
|
|
|
|
|
+ if (!grant.equals( 3)){
|
|
List<MobileUnit> all = mobileUnitRepository.findAll();
|
|
List<MobileUnit> all = mobileUnitRepository.findAll();
|
|
endMap.put("url",all);
|
|
endMap.put("url",all);
|
|
endMap.put("userName",mobileUser.getUserName());
|
|
endMap.put("userName",mobileUser.getUserName());
|
|
endMap.put("userId",mobileUser.getId());
|
|
endMap.put("userId",mobileUser.getId());
|
|
endMap.put("unit",mobileUser.getUnit());
|
|
endMap.put("unit",mobileUser.getUnit());
|
|
endMap.put("grant",grant);
|
|
endMap.put("grant",grant);
|
|
|
|
+ endMap.put("account",mobileUser.getAccount());
|
|
|
|
+ return new Result(10000,"登录成功",endMap);
|
|
}
|
|
}
|
|
if (grant == 3){
|
|
if (grant == 3){
|
|
|
|
|
|
@@ -66,11 +68,25 @@ public class MobileUserServiceImpl implements MobileUserService {
|
|
endMap.put("userId",mobileUser.getId());
|
|
endMap.put("userId",mobileUser.getId());
|
|
endMap.put("unit",mobileUser.getUnit());
|
|
endMap.put("unit",mobileUser.getUnit());
|
|
endMap.put("grant",grant);
|
|
endMap.put("grant",grant);
|
|
-
|
|
|
|
|
|
+ return new Result(10000,"登录成功",endMap);
|
|
}else {
|
|
}else {
|
|
return new Result(10002,"未找到权限信息");
|
|
return new Result(10002,"未找到权限信息");
|
|
}
|
|
}
|
|
|
|
|
|
- return new Result(10000,"登录成功",endMap);
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result updatePassword(Integer userId, String oldPassword, String newPassword) {
|
|
|
|
+ oldPassword = DigestUtils.md5DigestAsHex(oldPassword.getBytes());
|
|
|
|
+ newPassword = DigestUtils.md5DigestAsHex(newPassword.getBytes());
|
|
|
|
+
|
|
|
|
+ MobileUser mobileUser = userRepository.findById(userId).get();
|
|
|
|
+ if (!mobileUser.getPassword().equals(oldPassword)){
|
|
|
|
+ return new Result(10001,"原密码错误");
|
|
|
|
+ }
|
|
|
|
+ mobileUser.setPassword(newPassword);
|
|
|
|
+ userRepository.save(mobileUser);
|
|
|
|
+
|
|
|
|
+ return new Result(10000,"修改成功");
|
|
}
|
|
}
|
|
}
|
|
}
|