Commit 104c3297 by giaogiao

代码格式化

parent be93db03
package com.jumeirah.api.app.controller; package com.jumeirah.api.app.controller;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
...@@ -15,7 +14,6 @@ import java.io.IOException; ...@@ -15,7 +14,6 @@ import java.io.IOException;
/** /**
* Hello World Controller * Hello World Controller
*
**/ **/
@Slf4j @Slf4j
@Api(value = "Hello World2", tags = {"APP Hello World2"}) @Api(value = "Hello World2", tags = {"APP Hello World2"})
...@@ -46,6 +44,7 @@ public class AppHelloWorldController { ...@@ -46,6 +44,7 @@ public class AppHelloWorldController {
log.debug("Hello World...app"); log.debug("Hello World...app");
return ApiResult.ok("Hello World app"); return ApiResult.ok("Hello World app");
} }
@GetMapping(value = "/needRoleAdmin") @GetMapping(value = "/needRoleAdmin")
@OperationLog(name = "needRoleAdmin") @OperationLog(name = "needRoleAdmin")
@ApiOperation(value = "needRoleAdmin", response = String.class) @ApiOperation(value = "needRoleAdmin", response = String.class)
......
...@@ -2,5 +2,5 @@ package com.jumeirah.api.app.service; ...@@ -2,5 +2,5 @@ package com.jumeirah.api.app.service;
public interface AppRegisterService { public interface AppRegisterService {
void regiest(); void regiest();
} }
package com.jumeirah.api.merchant.controller; package com.jumeirah.api.merchant.controller;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
...@@ -14,7 +13,6 @@ import java.io.IOException; ...@@ -14,7 +13,6 @@ import java.io.IOException;
/** /**
* Hello World Controller * Hello World Controller
*
**/ **/
@Slf4j @Slf4j
@Api(value = "Hello World2", tags = {"商户Hello World2"}) @Api(value = "Hello World2", tags = {"商户Hello World2"})
......
...@@ -57,7 +57,7 @@ public class MerchantRegisterController { ...@@ -57,7 +57,7 @@ public class MerchantRegisterController {
@OperationLogIgnore @OperationLogIgnore
@ApiOperation(value = "注册", notes = "商户注册", response = LoginSysUserTokenVo.class) @ApiOperation(value = "注册", notes = "商户注册", response = LoginSysUserTokenVo.class)
public ApiResult<LoginSysUserTokenVo> register(@Validated @RequestBody RegisterParam registerParam, HttpServletResponse response, @RequestHeader(required = false) String language) throws Exception { public ApiResult<LoginSysUserTokenVo> register(@Validated @RequestBody RegisterParam registerParam, HttpServletResponse response, @RequestHeader(required = false) String language) throws Exception {
return registerService.register(registerParam, response,language); return registerService.register(registerParam, response, language);
} }
} }
...@@ -16,17 +16,17 @@ ...@@ -16,17 +16,17 @@
package com.jumeirah.api.system.controller; package com.jumeirah.api.system.controller;
import com.jumeirah.common.entity.SysDepartment;
import com.jumeirah.common.param.SysDepartmentPageParam;
import com.jumeirah.common.service.SysDepartmentService;
import com.jumeirah.common.vo.SysDepartmentQueryVo;
import com.jumeirah.common.vo.SysDepartmentTreeVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.log.annotation.Module; import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import com.jumeirah.common.entity.SysDepartment;
import com.jumeirah.common.param.SysDepartmentPageParam;
import com.jumeirah.common.service.SysDepartmentService;
import com.jumeirah.common.vo.SysDepartmentQueryVo;
import com.jumeirah.common.vo.SysDepartmentTreeVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
...@@ -16,18 +16,18 @@ ...@@ -16,18 +16,18 @@
package com.jumeirah.api.system.controller; package com.jumeirah.api.system.controller;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import com.jumeirah.common.entity.SysPermission; import com.jumeirah.common.entity.SysPermission;
import com.jumeirah.common.param.SysPermissionPageParam; import com.jumeirah.common.param.SysPermissionPageParam;
import com.jumeirah.common.service.SysPermissionService; import com.jumeirah.common.service.SysPermissionService;
import com.jumeirah.common.service.SysRolePermissionService; import com.jumeirah.common.service.SysRolePermissionService;
import com.jumeirah.common.vo.SysPermissionQueryVo; import com.jumeirah.common.vo.SysPermissionQueryVo;
import com.jumeirah.common.vo.SysPermissionTreeVo; import com.jumeirah.common.vo.SysPermissionTreeVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
package com.jumeirah.api.system.controller; package com.jumeirah.api.system.controller;
import com.jumeirah.common.entity.SysRole;
import com.jumeirah.common.param.sysrole.SysRolePageParam;
import com.jumeirah.common.param.sysrole.UpdateSysRolePermissionParam;
import com.jumeirah.common.service.SysRoleService;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
...@@ -24,10 +28,6 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update; ...@@ -24,10 +28,6 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.Module; import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import com.jumeirah.common.entity.SysRole;
import com.jumeirah.common.param.sysrole.SysRolePageParam;
import com.jumeirah.common.param.sysrole.UpdateSysRolePermissionParam;
import com.jumeirah.common.service.SysRoleService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
...@@ -16,6 +16,13 @@ ...@@ -16,6 +16,13 @@
package com.jumeirah.api.system.controller; package com.jumeirah.api.system.controller;
import com.jumeirah.common.entity.SysUser;
import com.jumeirah.common.param.sysuser.ResetPasswordParam;
import com.jumeirah.common.param.sysuser.SysUserPageParam;
import com.jumeirah.common.param.sysuser.UpdatePasswordParam;
import com.jumeirah.common.param.sysuser.UploadHeadParam;
import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.SysUserQueryVo;
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
...@@ -25,13 +32,6 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update; ...@@ -25,13 +32,6 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.Module; import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import com.jumeirah.common.entity.SysUser;
import com.jumeirah.common.param.sysuser.ResetPasswordParam;
import com.jumeirah.common.param.sysuser.SysUserPageParam;
import com.jumeirah.common.param.sysuser.UpdatePasswordParam;
import com.jumeirah.common.param.sysuser.UploadHeadParam;
import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.SysUserQueryVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
...@@ -16,11 +16,8 @@ ...@@ -16,11 +16,8 @@
package io.geekidea.springbootplus.config; package io.geekidea.springbootplus.config;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
...@@ -30,9 +27,7 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; ...@@ -30,9 +27,7 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
import io.geekidea.springbootplus.config.constant.DatePattern; import io.geekidea.springbootplus.config.constant.DatePattern;
import io.geekidea.springbootplus.framework.config.jackson.deserializer.JacksonDateDeserializer;
import io.geekidea.springbootplus.framework.config.jackson.deserializer.JacksonDoubleDeserializer; import io.geekidea.springbootplus.framework.config.jackson.deserializer.JacksonDoubleDeserializer;
import io.geekidea.springbootplus.framework.config.jackson.serializer.JacksonDateSerializer;
import io.geekidea.springbootplus.framework.config.jackson.serializer.JacksonIntegerDeserializer; import io.geekidea.springbootplus.framework.config.jackson.serializer.JacksonIntegerDeserializer;
import io.geekidea.springbootplus.framework.core.xss.XssJacksonDeserializer; import io.geekidea.springbootplus.framework.core.xss.XssJacksonDeserializer;
import io.geekidea.springbootplus.framework.core.xss.XssJacksonSerializer; import io.geekidea.springbootplus.framework.core.xss.XssJacksonSerializer;
...@@ -46,7 +41,6 @@ import java.time.LocalDate; ...@@ -46,7 +41,6 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
......
...@@ -211,7 +211,7 @@ public class ShiroConfig { ...@@ -211,7 +211,7 @@ public class ShiroConfig {
shiroFilterFactoryBean.setSecurityManager(securityManager); shiroFilterFactoryBean.setSecurityManager(securityManager);
// 设置过滤器 // 设置过滤器
Map<String, Filter> filterMap = getFilterMap(shiroLoginService, sysLoginRedisService, jwtProperties,redisTemplate); Map<String, Filter> filterMap = getFilterMap(shiroLoginService, sysLoginRedisService, jwtProperties, redisTemplate);
shiroFilterFactoryBean.setFilters(filterMap); shiroFilterFactoryBean.setFilters(filterMap);
// 设置过滤器顺序 // 设置过滤器顺序
Map<String, String> filterChainMap = getFilterChainDefinitionMap(shiroProperties); Map<String, String> filterChainMap = getFilterChainDefinitionMap(shiroProperties);
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
package io.geekidea.springbootplus.config; package io.geekidea.springbootplus.config;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.jumeirah.common.interceptor.DownloadInterceptor;
import com.jumeirah.common.interceptor.ResourceInterceptor;
import com.jumeirah.common.interceptor.UploadInterceptor;
import io.geekidea.springbootplus.config.properties.SpringBootPlusFilterProperties; import io.geekidea.springbootplus.config.properties.SpringBootPlusFilterProperties;
import io.geekidea.springbootplus.config.properties.SpringBootPlusInterceptorProperties; import io.geekidea.springbootplus.config.properties.SpringBootPlusInterceptorProperties;
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
...@@ -24,9 +27,6 @@ import io.geekidea.springbootplus.framework.core.filter.RequestDetailFilter; ...@@ -24,9 +27,6 @@ import io.geekidea.springbootplus.framework.core.filter.RequestDetailFilter;
import io.geekidea.springbootplus.framework.core.interceptor.PermissionInterceptor; import io.geekidea.springbootplus.framework.core.interceptor.PermissionInterceptor;
import io.geekidea.springbootplus.framework.core.xss.XssFilter; import io.geekidea.springbootplus.framework.core.xss.XssFilter;
import io.geekidea.springbootplus.framework.util.IniUtil; import io.geekidea.springbootplus.framework.util.IniUtil;
import com.jumeirah.common.interceptor.DownloadInterceptor;
import com.jumeirah.common.interceptor.ResourceInterceptor;
import com.jumeirah.common.interceptor.UploadInterceptor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
...@@ -18,6 +18,8 @@ package io.geekidea.springbootplus.handler; ...@@ -18,6 +18,8 @@ package io.geekidea.springbootplus.handler;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.auth0.jwt.exceptions.JWTDecodeException; import com.auth0.jwt.exceptions.JWTDecodeException;
import com.jumeirah.common.exception.SysLoginException;
import com.jumeirah.common.exception.VerificationCodeException;
import io.geekidea.springbootplus.framework.common.api.ApiCode; import io.geekidea.springbootplus.framework.common.api.ApiCode;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.exception.BusinessException; import io.geekidea.springbootplus.framework.common.exception.BusinessException;
...@@ -25,8 +27,6 @@ import io.geekidea.springbootplus.framework.common.exception.DaoException; ...@@ -25,8 +27,6 @@ import io.geekidea.springbootplus.framework.common.exception.DaoException;
import io.geekidea.springbootplus.framework.common.exception.SpringBootPlusException; import io.geekidea.springbootplus.framework.common.exception.SpringBootPlusException;
import io.geekidea.springbootplus.framework.core.bean.RequestDetail; import io.geekidea.springbootplus.framework.core.bean.RequestDetail;
import io.geekidea.springbootplus.framework.core.util.RequestDetailThreadLocal; import io.geekidea.springbootplus.framework.core.util.RequestDetailThreadLocal;
import com.jumeirah.common.exception.SysLoginException;
import com.jumeirah.common.exception.VerificationCodeException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authz.UnauthenticatedException; import org.apache.shiro.authz.UnauthenticatedException;
......
package com.jumeirah.common.entity; package com.jumeirah.common.entity;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
/** /**
* APP用户 * APP用户
...@@ -24,65 +24,65 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update; ...@@ -24,65 +24,65 @@ import io.geekidea.springbootplus.framework.core.validator.groups.Update;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AppUser对象") @ApiModel(value = "AppUser对象")
public class AppUser extends BaseEntity { public class AppUser extends BaseEntity {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class}) @NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键") @ApiModelProperty("主键")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
@ApiModelProperty("用户名") @ApiModelProperty("用户名")
private String username; private String username;
@ApiModelProperty("昵称") @ApiModelProperty("昵称")
private String nickname; private String nickname;
@NotBlank(message = "密码不能为空") @NotBlank(message = "密码不能为空")
@ApiModelProperty("密码") @ApiModelProperty("密码")
private String password; private String password;
@ApiModelProperty("盐值") @ApiModelProperty("盐值")
private String salt; private String salt;
@ApiModelProperty("手机号码") @ApiModelProperty("手机号码")
private String phone; private String phone;
@ApiModelProperty("手机区号") @ApiModelProperty("手机区号")
private String phoneArea; private String phoneArea;
@ApiModelProperty("性别,0:女,1:男,默认1") @ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender; private Integer gender;
@ApiModelProperty("头像") @ApiModelProperty("头像")
private String head; private String head;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定") @ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state; private Integer state;
@ApiModelProperty("部门id") @ApiModelProperty("部门id")
private Long departmentId; private Long departmentId;
@ApiModelProperty("角色id") @ApiModelProperty("角色id")
private Long roleId; private Long roleId;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除") @ApiModelProperty("逻辑删除,0:未删除,1:已删除")
@TableLogic @TableLogic
private Integer deleted; private Integer deleted;
@ApiModelProperty("版本") @ApiModelProperty("版本")
@Version @Version
private Integer version; private Integer version;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private Date updateTime; private Date updateTime;
} }
package com.jumeirah.common.mapper; package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.AppUser; import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.param.AppUserPageParam; import com.jumeirah.common.param.AppUserPageParam;
import com.jumeirah.common.vo.AppUserQueryVo; import com.jumeirah.common.vo.AppUserQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.io.Serializable; import java.io.Serializable;
...@@ -22,21 +20,21 @@ import java.io.Serializable; ...@@ -22,21 +20,21 @@ import java.io.Serializable;
@Repository @Repository
public interface AppUserMapper extends BaseMapper<AppUser> { public interface AppUserMapper extends BaseMapper<AppUser> {
/** /**
* 根据ID获取查询对象 * 根据ID获取查询对象
* *
* @param id * @param id
* @return * @return
*/ */
AppUserQueryVo getAppUserById(Serializable id); AppUserQueryVo getAppUserById(Serializable id);
/** /**
* 获取分页对象 * 获取分页对象
* *
* @param page * @param page
* @param appUserPageParam * @param appUserPageParam
* @return * @return
*/ */
IPage<AppUserQueryVo> getAppUserPageList(@Param("page") Page page,@Param("param") AppUserPageParam appUserPageParam); IPage<AppUserQueryVo> getAppUserPageList(@Param("page") Page page, @Param("param") AppUserPageParam appUserPageParam);
} }
...@@ -19,9 +19,9 @@ package com.jumeirah.common.mapper; ...@@ -19,9 +19,9 @@ package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.SysPermission;
import com.jumeirah.common.param.SysPermissionPageParam; import com.jumeirah.common.param.SysPermissionPageParam;
import com.jumeirah.common.vo.SysPermissionQueryVo; import com.jumeirah.common.vo.SysPermissionQueryVo;
import com.jumeirah.common.entity.SysPermission;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
......
...@@ -19,9 +19,9 @@ package com.jumeirah.common.mapper; ...@@ -19,9 +19,9 @@ package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.SysRole;
import com.jumeirah.common.param.sysrole.SysRolePageParam; import com.jumeirah.common.param.sysrole.SysRolePageParam;
import com.jumeirah.common.vo.SysRoleQueryVo; import com.jumeirah.common.vo.SysRoleQueryVo;
import com.jumeirah.common.entity.SysRole;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
......
...@@ -19,9 +19,9 @@ package com.jumeirah.common.mapper; ...@@ -19,9 +19,9 @@ package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.SysRolePermission;
import com.jumeirah.common.param.sysrole.SysRolePermissionPageParam; import com.jumeirah.common.param.sysrole.SysRolePermissionPageParam;
import com.jumeirah.common.vo.SysRolePermissionQueryVo; import com.jumeirah.common.vo.SysRolePermissionQueryVo;
import com.jumeirah.common.entity.SysRolePermission;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
......
package com.jumeirah.common.param; package com.jumeirah.common.param;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/** /**
* <pre> * <pre>
...@@ -18,6 +18,6 @@ import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam; ...@@ -18,6 +18,6 @@ import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "APP用户分页参数") @ApiModel(value = "APP用户分页参数")
public class AppUserPageParam extends BasePageOrderParam{ public class AppUserPageParam extends BasePageOrderParam {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
} }
...@@ -18,55 +18,56 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging; ...@@ -18,55 +18,56 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging;
*/ */
public interface AppUserService extends BaseService<AppUser> { public interface AppUserService extends BaseService<AppUser> {
ApiResult<LoginSysUserTokenVo> register(RegisterParam registerParam, String language); ApiResult<LoginSysUserTokenVo> register(RegisterParam registerParam, String language);
ApiResult<LoginSysUserTokenVo> login(LoginParam loginParam, String language);
ApiResult<LoginSysUserTokenVo> login(LoginParam loginParam, String language);
ApiResult<LoginSysUserTokenVo> phoneLogin(RegisterParam registerParam, String language); ApiResult<LoginSysUserTokenVo> phoneLogin(RegisterParam registerParam, String language);
/**
* 保存
*
* @param appUser
* @return
* @throws Exception
*/
boolean saveAppUser(AppUser appUser)throws Exception;
/** /**
* 修改 * 保存
* *
* @param appUser * @param appUser
* @return * @return
* @throws Exception * @throws Exception
*/ */
boolean updateAppUser(AppUser appUser)throws Exception; boolean saveAppUser(AppUser appUser) throws Exception;
/** /**
* 删除 * 修改
* *
* @param id * @param appUser
* @return * @return
* @throws Exception * @throws Exception
*/ */
boolean deleteAppUser(Long id)throws Exception; boolean updateAppUser(AppUser appUser) throws Exception;
/** /**
* 根据ID获取查询对象 * 删除
* *
* @param id * @param id
* @return * @return
* @throws Exception * @throws Exception
*/ */
AppUserQueryVo getAppUserById(Long id)throws Exception; boolean deleteAppUser(Long id) throws Exception;
/** /**
* 获取分页对象 * 根据ID获取查询对象
* *
* @param appUserPageParam * @param id
* @return * @return
* @throws Exception * @throws Exception
*/ */
Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception; AppUserQueryVo getAppUserById(Long id) throws Exception;
} /**
* 获取分页对象
*
* @param appUserPageParam
* @return
* @throws Exception
*/
Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception;
}
...@@ -117,7 +117,7 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser> ...@@ -117,7 +117,7 @@ public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser>
log.debug("token:{}", token); log.debug("token:{}", token);
// 创建AuthenticationToken // 创建AuthenticationToken
JwtToken jwtToken = JwtToken.build(token, username, newSalt, expireSecond,"app"); JwtToken jwtToken = JwtToken.build(token, username, newSalt, expireSecond, "app");
boolean enableShiro = springBootPlusProperties.getShiro().isEnable(); boolean enableShiro = springBootPlusProperties.getShiro().isEnable();
if (enableShiro) { if (enableShiro) {
......
...@@ -120,7 +120,7 @@ public class SysLoginServiceImpl implements SysLoginService { ...@@ -120,7 +120,7 @@ public class SysLoginServiceImpl implements SysLoginService {
log.error("登录失败,loginParam:{}", loginParam); log.error("登录失败,loginParam:{}", loginParam);
// throw new AuthenticationException("用户名或密码错误"); // throw new AuthenticationException("用户名或密码错误");
return ApiResult.fail(ApiCode.PWD_OR_USERNAME_ERROR, language); return ApiResult.fail(ApiCode.PWD_OR_USERNAME_ERROR, language);
} }
if (StateEnum.DISABLE.getCode().equals(sysUser.getState())) { if (StateEnum.DISABLE.getCode().equals(sysUser.getState())) {
throw new AuthenticationException("账号已禁用"); throw new AuthenticationException("账号已禁用");
...@@ -132,7 +132,7 @@ public class SysLoginServiceImpl implements SysLoginService { ...@@ -132,7 +132,7 @@ public class SysLoginServiceImpl implements SysLoginService {
// 后台加密规则:sha256(sha256(123456) + salt) // 后台加密规则:sha256(sha256(123456) + salt)
String encryptPassword = PasswordUtil.encrypt(loginParam.getPassword(), sysUser.getSalt()); String encryptPassword = PasswordUtil.encrypt(loginParam.getPassword(), sysUser.getSalt());
if (!encryptPassword.equals(sysUser.getPassword())) { if (!encryptPassword.equals(sysUser.getPassword())) {
return ApiResult.fail(ApiCode.PWD_OR_USERNAME_ERROR, language); return ApiResult.fail(ApiCode.PWD_OR_USERNAME_ERROR, language);
} }
// 将系统用户对象转换成登录用户对象 // 将系统用户对象转换成登录用户对象
...@@ -178,7 +178,7 @@ public class SysLoginServiceImpl implements SysLoginService { ...@@ -178,7 +178,7 @@ public class SysLoginServiceImpl implements SysLoginService {
log.debug("token:{}", token); log.debug("token:{}", token);
// 创建AuthenticationToken // 创建AuthenticationToken
JwtToken jwtToken = JwtToken.build(token, username, newSalt, expireSecond,"sys"); JwtToken jwtToken = JwtToken.build(token, username, newSalt, expireSecond, "sys");
boolean enableShiro = springBootPlusProperties.getShiro().isEnable(); boolean enableShiro = springBootPlusProperties.getShiro().isEnable();
if (enableShiro) { if (enableShiro) {
......
...@@ -4,11 +4,11 @@ import cn.hutool.core.util.RandomUtil; ...@@ -4,11 +4,11 @@ import cn.hutool.core.util.RandomUtil;
import com.jumeirah.common.entity.SysUser; import com.jumeirah.common.entity.SysUser;
import com.jumeirah.common.param.LoginParam; import com.jumeirah.common.param.LoginParam;
import com.jumeirah.common.param.RegisterParam; import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.service.SysLoginService;
import com.jumeirah.common.service.SysRegisterService; import com.jumeirah.common.service.SysRegisterService;
import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.LoginSysUserTokenVo; import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import com.jumeirah.common.service.SysLoginService;
import com.jumeirah.common.service.SysUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
...@@ -26,6 +26,8 @@ import com.jumeirah.common.mapper.SysUserMapper; ...@@ -26,6 +26,8 @@ import com.jumeirah.common.mapper.SysUserMapper;
import com.jumeirah.common.param.sysuser.ResetPasswordParam; import com.jumeirah.common.param.sysuser.ResetPasswordParam;
import com.jumeirah.common.param.sysuser.SysUserPageParam; import com.jumeirah.common.param.sysuser.SysUserPageParam;
import com.jumeirah.common.param.sysuser.UpdatePasswordParam; import com.jumeirah.common.param.sysuser.UpdatePasswordParam;
import com.jumeirah.common.service.SysDepartmentService;
import com.jumeirah.common.service.SysRoleService;
import com.jumeirah.common.service.SysUserService; import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.SysUserQueryVo; import com.jumeirah.common.vo.SysUserQueryVo;
import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties; import io.geekidea.springbootplus.config.properties.SpringBootPlusProperties;
...@@ -36,8 +38,6 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging; ...@@ -36,8 +38,6 @@ import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.shiro.util.SaltUtil; import io.geekidea.springbootplus.framework.shiro.util.SaltUtil;
import io.geekidea.springbootplus.framework.util.PasswordUtil; import io.geekidea.springbootplus.framework.util.PasswordUtil;
import io.geekidea.springbootplus.framework.util.PhoneUtil; import io.geekidea.springbootplus.framework.util.PhoneUtil;
import com.jumeirah.common.service.SysDepartmentService;
import com.jumeirah.common.service.SysRoleService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
......
...@@ -19,57 +19,57 @@ import java.util.Date; ...@@ -19,57 +19,57 @@ import java.util.Date;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "AppUserQueryVo对象") @ApiModel(value = "AppUserQueryVo对象")
public class AppUserQueryVo implements Serializable{ public class AppUserQueryVo implements Serializable {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("主键") @ApiModelProperty("主键")
private Long id; private Long id;
@ApiModelProperty("用户名") @ApiModelProperty("用户名")
private String username; private String username;
@ApiModelProperty("昵称") @ApiModelProperty("昵称")
private String nickname; private String nickname;
@ApiModelProperty("密码") @ApiModelProperty("密码")
private String password; private String password;
@ApiModelProperty("盐值") @ApiModelProperty("盐值")
private String salt; private String salt;
@ApiModelProperty("手机号码") @ApiModelProperty("手机号码")
private String phone; private String phone;
@ApiModelProperty("手机区号") @ApiModelProperty("手机区号")
private String phoneArea; private String phoneArea;
@ApiModelProperty("性别,0:女,1:男,默认1") @ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender; private Integer gender;
@ApiModelProperty("头像") @ApiModelProperty("头像")
private String head; private String head;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定") @ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state; private Integer state;
@ApiModelProperty("部门id") @ApiModelProperty("部门id")
private Long departmentId; private Long departmentId;
@ApiModelProperty("角色id") @ApiModelProperty("角色id")
private Long roleId; private Long roleId;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除") @ApiModelProperty("逻辑删除,0:未删除,1:已删除")
private Integer deleted; private Integer deleted;
@ApiModelProperty("版本") @ApiModelProperty("版本")
private Integer version; private Integer version;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private Date updateTime; private Date updateTime;
} }
\ No newline at end of file
...@@ -2,21 +2,22 @@ ...@@ -2,21 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.AppUserMapper"> <mapper namespace="com.jumeirah.common.mapper.AppUserMapper">
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, username, nickname, password, salt, phone, phone_area, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time id, username, nickname, password, salt, phone, phone_area, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time
</sql> </sql>
<select id="getAppUserById" resultType="com.jumeirah.common.vo.AppUserQueryVo"> <select id="getAppUserById" resultType="com.jumeirah.common.vo.AppUserQueryVo">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from app_user where id = #{id} from app_user where id = #{id}
</select> </select>
<select id="getAppUserPageList" parameterType="com.jumeirah.common.param.AppUserPageParam" resultType="com.jumeirah.common.vo.AppUserQueryVo"> <select id="getAppUserPageList" parameterType="com.jumeirah.common.param.AppUserPageParam"
select resultType="com.jumeirah.common.vo.AppUserQueryVo">
<include refid="Base_Column_List"/> select
from app_user <include refid="Base_Column_List"/>
</select> from app_user
</select>
</mapper> </mapper>
...@@ -55,5 +55,5 @@ public interface SysLoginRedisKey { ...@@ -55,5 +55,5 @@ public interface SysLoginRedisKey {
* login:user:token:username:* * login:user:token:username:*
*/ */
String LOGIN_USER_ALL_TOKEN = "sys:login:user:token:%s:*"; String LOGIN_USER_ALL_TOKEN = "sys:login:user:token:%s:*";
} }
...@@ -189,7 +189,7 @@ spring-boot-plus: ...@@ -189,7 +189,7 @@ spring-boot-plus:
# 排除Swagger # 排除Swagger
- ${spring-boot-plus.swagger-paths} - ${spring-boot-plus.swagger-paths}
# 排除actuator # 排除actuator
# - /actuator/** # - /actuator/**
- # 排除首页 - # 排除首页
- /,/index.html - /,/index.html
- /app/noRole - /app/noRole
...@@ -200,7 +200,7 @@ spring-boot-plus: ...@@ -200,7 +200,7 @@ spring-boot-plus:
/upload/**=anon /upload/**=anon
/verificationCode/**=anon /verificationCode/**=anon
/enum=anon /enum=anon
# /app/**=roles["app:all"] # /app/**=roles["app:all"]
######################## Spring Shiro end ########################## ######################## Spring Shiro end ##########################
......
...@@ -75,5 +75,4 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION ...@@ -75,5 +75,4 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION
#* 默认的异常处理 #* 默认的异常处理
#*/ #*/
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION
api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error
\ No newline at end of file
...@@ -75,5 +75,4 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION ...@@ -75,5 +75,4 @@ api.response.code.JWTDECODE_EXCEPTION=JWTDECODE_EXCEPTION
#* 默认的异常处理 #* 默认的异常处理
#*/ #*/
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION
api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error KH api.response.code.user.PWD_OR_USERNAME_ERROR=password or phone number error KH
\ No newline at end of file
...@@ -75,5 +75,4 @@ api.response.code.JWTDECODE_EXCEPTION=Token解析异常 ...@@ -75,5 +75,4 @@ api.response.code.JWTDECODE_EXCEPTION=Token解析异常
#* 默认的异常处理 #* 默认的异常处理
#*/ #*/
api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=默认的异常处理 api.response.code.HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION=默认的异常处理
api.response.code.user.PWD_OR_USERNAME_ERROR=账号或密码错误 api.response.code.user.PWD_OR_USERNAME_ERROR=账号或密码错误
\ No newline at end of file
...@@ -109,7 +109,6 @@ public class ApiResult<T> implements Serializable { ...@@ -109,7 +109,6 @@ public class ApiResult<T> implements Serializable {
} }
return (ApiResult<T>) ApiResult.builder() return (ApiResult<T>) ApiResult.builder()
.code(apiCode.getCode()) .code(apiCode.getCode())
.message(message) .message(message)
......
...@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import java.time.Duration; import java.time.Duration;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@Service @Service
public class AppLoginRedisServiceImpl implements AppLoginRedisService { public class AppLoginRedisServiceImpl implements AppLoginRedisService {
......
...@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import java.time.Duration; import java.time.Duration;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@Service @Service
public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService { public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService {
......
...@@ -51,13 +51,10 @@ import javax.servlet.http.HttpServletResponse; ...@@ -51,13 +51,10 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j @Slf4j
public class JwtFilter extends AuthenticatingFilter { public class JwtFilter extends AuthenticatingFilter {
private RedisTemplate redisTemplate;
private final ShiroLoginService shiroLoginService; private final ShiroLoginService shiroLoginService;
private final SysLoginRedisService sysLoginRedisService; private final SysLoginRedisService sysLoginRedisService;
private final JwtProperties jwtProperties; private final JwtProperties jwtProperties;
private RedisTemplate redisTemplate;
public JwtFilter(ShiroLoginService shiroLoginService, SysLoginRedisService loginRedisService, JwtProperties jwtProperties, RedisTemplate redisTemplate) { public JwtFilter(ShiroLoginService shiroLoginService, SysLoginRedisService loginRedisService, JwtProperties jwtProperties, RedisTemplate redisTemplate) {
this.shiroLoginService = shiroLoginService; this.shiroLoginService = shiroLoginService;
...@@ -105,7 +102,7 @@ public class JwtFilter extends AuthenticatingFilter { ...@@ -105,7 +102,7 @@ public class JwtFilter extends AuthenticatingFilter {
} else { } else {
salt = jwtProperties.getSecret(); salt = jwtProperties.getSecret();
} }
JwtTokenRedisVo jwt = (JwtTokenRedisVo) jwtTokenRedisVo; JwtTokenRedisVo jwt = (JwtTokenRedisVo) jwtTokenRedisVo;
return JwtToken.build(token, username, salt, jwtProperties.getExpireSecond(), jwt.getType()); return JwtToken.build(token, username, salt, jwtProperties.getExpireSecond(), jwt.getType());
} }
......
...@@ -72,7 +72,7 @@ public class JwtToken implements HostAuthenticationToken { ...@@ -72,7 +72,7 @@ public class JwtToken implements HostAuthenticationToken {
private String credentials; private String credentials;
public static JwtToken build(String token, String username, String salt, long expireSecond,String type) { public static JwtToken build(String token, String username, String salt, long expireSecond, String type) {
DecodedJWT decodedJwt = JwtUtil.getJwtInfo(token); DecodedJWT decodedJwt = JwtUtil.getJwtInfo(token);
Date createDate = decodedJwt.getIssuedAt(); Date createDate = decodedJwt.getIssuedAt();
Date expireDate = decodedJwt.getExpiresAt(); Date expireDate = decodedJwt.getExpiresAt();
......
...@@ -63,7 +63,7 @@ public class JwtRealmSystem extends AuthorizingRealm { ...@@ -63,7 +63,7 @@ public class JwtRealmSystem extends AuthorizingRealm {
// 设置角色/权限信息 // 设置角色/权限信息
JwtToken jwtToken = (JwtToken) principalCollection.getPrimaryPrincipal(); JwtToken jwtToken = (JwtToken) principalCollection.getPrimaryPrincipal();
if (!jwtToken.getType().equals("sys")){ if (!jwtToken.getType().equals("sys")) {
return null; return null;
} }
// 获取username // 获取username
......
...@@ -103,7 +103,7 @@ public class ShiroLoginServiceImpl implements ShiroLoginService { ...@@ -103,7 +103,7 @@ public class ShiroLoginServiceImpl implements ShiroLoginService {
// 生成新token字符串 // 生成新token字符串
String newToken = JwtUtil.generateToken(username, salt, Duration.ofSeconds(expireSecond)); String newToken = JwtUtil.generateToken(username, salt, Duration.ofSeconds(expireSecond));
// 生成新JwtToken对象 // 生成新JwtToken对象
JwtToken newJwtToken = JwtToken.build(newToken, username, salt, expireSecond,jwtToken.getType()); JwtToken newJwtToken = JwtToken.build(newToken, username, salt, expireSecond, jwtToken.getType());
// 更新redis缓存 // 更新redis缓存
sysLoginRedisService.refreshLoginInfo(token, username, newJwtToken); sysLoginRedisService.refreshLoginInfo(token, username, newJwtToken);
log.debug("刷新token成功,原token:{},新token:{}", token, newToken); log.debug("刷新token成功,原token:{},新token:{}", token, newToken);
......
...@@ -56,7 +56,7 @@ public class LoginUtil { ...@@ -56,7 +56,7 @@ public class LoginUtil {
} }
// return (LoginSysUserRedisVo) redisTemplate.opsForValue().get(String.format(CommonRedisKey.LOGIN_USER, username)); // return (LoginSysUserRedisVo) redisTemplate.opsForValue().get(String.format(CommonRedisKey.LOGIN_USER, username));
LoginSysUserRedisVo loginSysUserRedisVo =new LoginSysUserRedisVo(); LoginSysUserRedisVo loginSysUserRedisVo = new LoginSysUserRedisVo();
loginSysUserRedisVo.setUsername(username); loginSysUserRedisVo.setUsername(username);
return loginSysUserRedisVo; return loginSysUserRedisVo;
} }
......
...@@ -38,10 +38,6 @@ public class VerificationCode { ...@@ -38,10 +38,6 @@ public class VerificationCode {
*/ */
private final int height = 38; private final int height = 38;
/** /**
* 用来保存验证码的文本内容
**/
private String text;
/**
* 获取随机数对象 * 获取随机数对象
**/ **/
private final Random r = new Random(); private final Random r = new Random();
...@@ -57,6 +53,10 @@ public class VerificationCode { ...@@ -57,6 +53,10 @@ public class VerificationCode {
* 生成的验证码的个数 * 生成的验证码的个数
**/ **/
private final int codeNum = 4; private final int codeNum = 4;
/**
* 用来保存验证码的文本内容
**/
private String text;
/** /**
* 获取随机的颜色 * 获取随机的颜色
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<module>admin</module> <module>admin</module>
<module>bootstrap</module> <module>bootstrap</module>
<module>config</module> <module>config</module>
<!-- <module>distribution</module>--> <!-- <module>distribution</module>-->
<module>framework</module> <module>framework</module>
<module>generator</module> <module>generator</module>
<module>scheduled</module> <module>scheduled</module>
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<description>任务调度JOB模块</description> <description>任务调度JOB模块</description>
<dependencies> <dependencies>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>io.geekidea.springbootplus</groupId>--> <!-- <groupId>io.geekidea.springbootplus</groupId>-->
<!-- <artifactId>example</artifactId>--> <!-- <artifactId>example</artifactId>-->
<!-- </dependency>--> <!-- </dependency>-->
</dependencies> </dependencies>
</project> </project>
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