Commit 4aed6bba by 1539136324@qq.com

修改登录BUG

1 parent 8417d1a6
...@@ -130,7 +130,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -130,7 +130,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/wecom/community/h5/**").anonymous() .antMatchers("/wecom/community/h5/**").anonymous()
//微信授权接口 //微信授权接口
.antMatchers("/weixin/auth/**").anonymous() .antMatchers("/weixin/auth/**").anonymous()
.antMatchers("/login").anonymous()
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated() .anyRequest().authenticated()
......
...@@ -62,21 +62,21 @@ public class UserDetailsServiceImpl implements UserDetailsService ...@@ -62,21 +62,21 @@ public class UserDetailsServiceImpl implements UserDetailsService
SysUser user = userService.selectUserByUserName(username); SysUser user = userService.selectUserByUserName(username);
if (StringUtils.isNull(user)) if (StringUtils.isNull(user))
{ {
//企业管理登录 // //企业管理登录
//查询企业管理相关账号 // //查询企业管理相关账号
WeCorpAccount weCorpByAccount = iWeCorpAccountService.findWeCorpByAccount(username); // WeCorpAccount weCorpByAccount = iWeCorpAccountService.findWeCorpByAccount(username);
if(null != weCorpByAccount){ // if(null != weCorpByAccount){
//注册到we_user表中 // //注册到we_user表中
user=SysUser.builder() // user=SysUser.builder()
.userName(weCorpByAccount.getCropAccount()) // .userName(weCorpByAccount.getCropAccount())
.nickName(weCorpByAccount.getCompanyName()) // .nickName(weCorpByAccount.getCompanyName())
.userType(Constants.USER_TYOE_CORP_ADMIN) // .userType(Constants.USER_TYOE_CORP_ADMIN)
.roleIds(ArrayUtil.toArray(roleMapper.selectRoleList(SysRole.builder() // .roleIds(ArrayUtil.toArray(roleMapper.selectRoleList(SysRole.builder()
.roleKey(Constants.DEFAULT_WECOME_CORP_ADMIN) // .roleKey(Constants.DEFAULT_WECOME_CORP_ADMIN)
.build()).stream().map(SysRole::getRoleId).collect(Collectors.toList()), Long.class)) // .build()).stream().map(SysRole::getRoleId).collect(Collectors.toList()), Long.class))
.password(SecurityUtils.encryptPassword(ruoYiConfig.getWeUserDefaultPwd())) // .password(SecurityUtils.encryptPassword(ruoYiConfig.getWeUserDefaultPwd()))
.build(); // .build();
} // }
// else{ // else{
// //
...@@ -119,11 +119,11 @@ public class UserDetailsServiceImpl implements UserDetailsService ...@@ -119,11 +119,11 @@ public class UserDetailsServiceImpl implements UserDetailsService
} }
//当前登录用户为企业管理,设置corpId和密钥相关 //当前登录用户为企业管理,设置corpId和密钥相关
if(user.getUserType().equals(Constants.USER_TYOE_CORP_ADMIN)){ // if(user.getUserType().equals(Constants.USER_TYOE_CORP_ADMIN)){
user.setWeCorpAccount( // user.setWeCorpAccount(
iWeCorpAccountService.findWeCorpByAccount(username) // iWeCorpAccountService.findWeCorpByAccount(username)
); // );
} // }
return createLoginUser(user); return createLoginUser(user);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!