use of io.jpom.model.dto.UserLoginDto in project Jpom by dromara.
the class UserService method getUserJwtId.
/**
* 查询用户 jwt id
*
* @param userModel 用户
* @return jwt id
*/
public UserLoginDto getUserJwtId(UserModel userModel) {
String id = userModel.getId();
String sql = "select password from USER_INFO where id=?";
List<Entity> query = super.query(sql, id);
Entity first = CollUtil.getFirst(query);
Assert.notEmpty(first, "没有对应的用户信息");
String password = (String) first.get("password");
Assert.hasText(password, "没有对应的用户信息");
return new UserLoginDto(JwtUtil.builder(userModel, password), password);
}
Aggregations