|
...
|
...
|
@@ -6,10 +6,12 @@ import com.zhonglai.luhui.action.BaseController; |
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import com.zhonglai.luhui.dao.service.PublicService;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
@Api(tags = "用户")
|
|
...
|
...
|
@@ -19,6 +21,9 @@ public class UserInfoController extends BaseController { |
|
|
|
@Autowired
|
|
|
|
protected PublicService publicService ;
|
|
|
|
|
|
|
|
@Value("${token.header}")
|
|
|
|
private String LOGIN_TOKEN_KEY;
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取用户信息",notes = "返回参数说明:\n" +
|
|
|
|
"`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',\n" +
|
|
|
|
" `username` varchar(50) NOT NULL COMMENT '用户登录名',\n" +
|
|
...
|
...
|
@@ -125,6 +130,16 @@ public class UserInfoController extends BaseController { |
|
|
|
return AjaxResult.success(publicService.updateObject(userInfo,"id"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation("退出登录")
|
|
|
|
@RequestMapping(value = "signOut", method = RequestMethod.POST)
|
|
|
|
public AjaxResult signOut()
|
|
|
|
{
|
|
|
|
HttpServletRequest request = getRequest();
|
|
|
|
request.getSession().removeAttribute(LOGIN_TOKEN_KEY);
|
|
|
|
request.getSession().invalidate();
|
|
|
|
return AjaxResult.success();
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final Pattern DATETIME_PATTERN =
|
|
|
|
Pattern.compile("^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])\\s(2[0-3]|[01]\\d):[0-5]\\d:[0-5]\\d$");
|
|
|
|
|
...
|
...
|
|