use of com.baidu.disconf.web.service.user.vo.VisitorVo in project disconf by knightliao.
the class UserMgrImpl method getCurVisitor.
@Override
public VisitorVo getCurVisitor() {
Visitor visitor = ThreadContext.getSessionVisitor();
if (visitor == null) {
return null;
}
VisitorVo visitorVo = new VisitorVo();
visitorVo.setId(visitor.getId());
visitorVo.setName(visitor.getLoginUserName());
return visitorVo;
}
use of com.baidu.disconf.web.service.user.vo.VisitorVo in project disconf by knightliao.
the class UserController method signin.
/**
* 登录
*
* @param signin
* @param request
*
* @return
*/
@NoAuth
@RequestMapping(value = "/signin", method = RequestMethod.POST)
@ResponseBody
public JsonObjectBase signin(@Valid SigninForm signin, HttpServletRequest request) {
LOG.info(signin.toString());
// 验证
authValidator.validateLogin(signin);
// 数据库登录
User user = signMgr.signin(signin.getName());
// 过期时间
int expireTime = LoginConstant.SESSION_EXPIRE_TIME;
if (signin.getRemember().equals(1)) {
expireTime = LoginConstant.SESSION_EXPIRE_TIME2;
}
// redis login
redisLogin.login(request, user, expireTime);
VisitorVo visitorVo = userMgr.getCurVisitor();
return buildSuccess("visitor", visitorVo);
}
Aggregations