提交 c9231103 编写于 作者: twelvet's avatar twelvet

修改状态表示

上级 9e5b0f27
此差异已折叠。
......@@ -193,8 +193,8 @@ CREATE TABLE `sys_job` (
`invoke_target` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调用目标字符串',
`cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式',
`misfire_policy` tinyint(1) NULL DEFAULT NULL COMMENT '计划执行错误策略(1立即执行 2执行一次 3放弃执行)',
`concurrent` tinyint(1) NULL DEFAULT NULL COMMENT '是否并发执行(1允许 0禁止)',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(1正常 0暂停)',
`concurrent` tinyint(1) NULL DEFAULT NULL COMMENT '是否并发执行(0允许 1禁止)',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1暂停)',
`create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
......
......@@ -35,7 +35,7 @@ public class SysDictType extends BaseEntity {
* 状态(0正常 1停用)
*/
@Excel(name = "状态", readConverterExp = "1=正常,0=停用")
private Integer status;
private String status;
public Long getDictId() {
return dictId;
......@@ -65,11 +65,11 @@ public class SysDictType extends BaseEntity {
this.dictType = dictType;
}
public Integer getStatus() {
public String getStatus() {
return status;
}
public void setStatus(Integer status) {
public void setStatus(String status) {
this.status = status;
}
......
......@@ -62,12 +62,12 @@ public class SysMenu extends BaseEntity {
/**
* 显示状态(1显示 0隐藏)
*/
private Integer visible;
private String visible;
/**
* 菜单状态(1显示 0隐藏)
*/
private Integer status;
private String status;
/**
* 权限字符串
......@@ -156,19 +156,19 @@ public class SysMenu extends BaseEntity {
this.menuType = menuType;
}
public Integer getVisible() {
public String getVisible() {
return visible;
}
public void setVisible(Integer visible) {
public void setVisible(String visible) {
this.visible = visible;
}
public Integer getStatus() {
public String getStatus() {
return status;
}
public void setStatus(Integer status) {
public void setStatus(String status) {
this.status = status;
}
......
......@@ -41,7 +41,7 @@ public class SysRole extends BaseEntity {
/**
* 角色状态(0正常 1停用)
*/
private Integer status;
private String status;
/**
* 删除标志(0代表存在 2代表删除)
......@@ -119,11 +119,11 @@ public class SysRole extends BaseEntity {
this.dataScope = dataScope;
}
public Integer getStatus() {
public String getStatus() {
return status;
}
public void setStatus(Integer status) {
public void setStatus(String status) {
this.status = status;
}
......
......@@ -56,18 +56,20 @@ public class AuthorizationServerConfiguration {
// 登录失败处理器
.errorResponseHandler(new TWTAuthenticationFailureEventHandler());
})
// 个性化客户端认证
.clientAuthentication(oAuth2ClientAuthenticationConfigurer -> {
AuthenticationConverter authenticationConverter = new DelegatingAuthenticationConverter(Arrays.asList(
new JwtClientAssertionAuthenticationConverter(), new ClientSecretBasicAuthenticationConverter(),
new ClientSecretPostAuthenticationConverter(), new PublicClientAuthenticationConverter()));
oAuth2ClientAuthenticationConfigurer.authenticationConverter(authenticationConverter)
// 处理客户端认证异常
.errorResponseHandler(new TWTAuthenticationFailureEventHandler());
}).authorizationEndpoint(authorizationEndpoint -> authorizationEndpoint
// 授权码端点个性化confirm页面
.consentPage(SecurityConstants.CUSTOM_CONSENT_PAGE_URI)));
// 个性化客户端认证
.clientAuthentication(oAuth2ClientAuthenticationConfigurer -> {
AuthenticationConverter authenticationConverter = new DelegatingAuthenticationConverter(
Arrays.asList(new JwtClientAssertionAuthenticationConverter(),
new ClientSecretBasicAuthenticationConverter(),
new ClientSecretPostAuthenticationConverter(),
new PublicClientAuthenticationConverter()));
oAuth2ClientAuthenticationConfigurer.authenticationConverter(authenticationConverter)
// 处理客户端认证异常
.errorResponseHandler(new TWTAuthenticationFailureEventHandler());
}).authorizationEndpoint(authorizationEndpoint -> authorizationEndpoint
// 授权码端点个性化confirm页面
.consentPage(SecurityConstants.CUSTOM_CONSENT_PAGE_URI)));
RequestMatcher endpointsMatcher = authorizationServerConfigurer.getEndpointsMatcher();
DefaultSecurityFilterChain securityFilterChain = http.requestMatcher(endpointsMatcher)
......
......@@ -69,7 +69,7 @@ public class TwTUserDetailsServiceImpl implements TwUserDetailsService {
// 获取用户状态信息
SysUser sysUser = userInfo.getData().getSysUser();
if (sysUser.getStatus().equals(0)) {
if (sysUser.getStatus().equals("1")) {
log.info("{}: 用户已被冻结.", username);
throw new TWTException("账号已被冻结");
}
......
......@@ -12,6 +12,7 @@ import com.twelvet.framework.jdbc.web.utils.PageUtils;
import com.twelvet.framework.log.annotation.Log;
import com.twelvet.framework.log.enums.BusinessType;
import com.twelvet.framework.security.utils.SecurityUtils;
import com.twelvet.framework.utils.StringUtils;
import com.twelvet.framework.utils.poi.ExcelUtils;
import com.twelvet.framework.utils.$;
import com.twelvet.server.system.service.*;
......@@ -208,11 +209,13 @@ public class SysUserController extends TWTController {
public AjaxResult edit(@Validated @RequestBody SysUser user) {
iSysUserService.checkUserAllowed(user);
iSysUserService.checkUserDataScope(user.getUserId());
if (UserConstants.NOT_UNIQUE.equals(iSysUserService.checkPhoneUnique(user))) {
return AjaxResult.error("修改用户信息失败,手机号码已存在");
if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.NOT_UNIQUE.equals(iSysUserService.checkPhoneUnique(user))) {
return AjaxResult.error("修改用户'" + user.getUsername() + "'失败,手机号码已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(iSysUserService.checkEmailUnique(user))) {
return AjaxResult.error("修改用户信息失败,邮箱账号已存在");
else if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.NOT_UNIQUE.equals(iSysUserService.checkEmailUnique(user))) {
return AjaxResult.error("修改用户'" + user.getUsername() + "'失败,邮箱账号已存在");
}
user.setUpdateBy(SecurityUtils.getUsername());
return json(iSysUserService.updateUser(user));
......
......@@ -117,7 +117,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
List<RouterVo> routers = new LinkedList<>();
for (SysMenu menu : menus) {
RouterVo router = new RouterVo();
router.setHidden(menu.getVisible() == 1);
router.setHidden(menu.getVisible().equals("1"));
router.setName(menu.getMenuName());
router.setPath(getRouterPath(menu));
router.setComponent(getComponent(menu));
......
......@@ -49,7 +49,7 @@
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 1
from sys_menu m where m.menu_type in ('M', 'C') and m.status = '0'
order by m.parent_id, m.order_num
</select>
......@@ -79,7 +79,7 @@
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 1 AND ro.status = 1
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = '0' AND ro.status = '0'
order by m.parent_id, m.order_num
</select>
......@@ -104,7 +104,7 @@
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role r on r.role_id = ur.role_id
where m.status = '1' and r.status = '1' and ur.user_id = #{userId}
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册