|
|
|
@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.base.ISynchronizedService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.base.ISystemLoginStrategyService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.*;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.dto.LanguageDTO;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.dto.SysMenuDTO;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.controller.busi.*;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.util.MailUtil;
|
|
|
|
@ -66,7 +67,7 @@ import com.google.common.cache.CacheBuilder;
|
|
|
|
|
import com.taobao.api.ApiException;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.val;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.shiro.authc.*;
|
|
|
|
@ -86,7 +87,6 @@ import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.function.BiFunction;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
@ -491,10 +491,10 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
// 记录登录记录
|
|
|
|
|
SessionUser sessionUser = (SessionUser)result.getResultObject();
|
|
|
|
|
if(StringUtil.isEmpty(sessionUser) && StringUtil.isEmpty(sessionUser.getUserId())){
|
|
|
|
|
recordSysUserLog(sessionUser.getUserId(), loginModel.getLoginName(), userLoginStatus.getValue());
|
|
|
|
|
} else {
|
|
|
|
|
if(StringUtil.isEmpty(sessionUser) || StringUtil.isEmpty(sessionUser.getUserId())){
|
|
|
|
|
recordSysUserLog(null, loginModel.getLoginName(), userLoginStatus.getValue());
|
|
|
|
|
} else {
|
|
|
|
|
recordSysUserLog(sessionUser.getUserId(), loginModel.getLoginName(), userLoginStatus.getValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -518,10 +518,10 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/find-language-code")
|
|
|
|
|
@ApiOperation(value = "根据语言代码查询资源")
|
|
|
|
|
public ResultBean findSysLocaleResourceByLanguageCode(@RequestParam String languageCode) {
|
|
|
|
|
public ResultBean findSysLocaleResourceByLanguageCode(@RequestBody LanguageDTO languageCodeDto) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
String languageCode = languageCodeDto.getLanguageCode();
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode, "语言代码不能为空");
|
|
|
|
|
if (sysLocaleLanguageService.getSysLocaleLanguageByCode(languageCode) == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
@ -1610,4 +1610,44 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取未用户功能权限信息
|
|
|
|
|
*
|
|
|
|
|
* @param parentId 菜单id
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/no/login/menu/list")
|
|
|
|
|
@ApiOperation(value = "获取登录用户功能权限信息", notes = "获取首页权限信息")
|
|
|
|
|
public ResultBean findModuleListByNoLogin(@RequestParam String parentId, @RequestParam String userId) {
|
|
|
|
|
try {
|
|
|
|
|
ValidatorBean.checkIsNumber(parentId, "父节点不能为空");
|
|
|
|
|
|
|
|
|
|
List<SysMenu> result = memTreeService.packTreeSysMenuByUserIdAndParentId(Long.valueOf(userId), Long.parseLong(parentId));
|
|
|
|
|
result = findChildList(result);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
|
|
|
|
|
.setResultList(result);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}", busExcep.getErrorDetail(), busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
LOGGER.error(LocaleUtils.getEnumLocaleResDesc(ImppExceptionEnum.SYSTEM_EXCEPTION,
|
|
|
|
|
ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription()) + ":{}", e.getMessage(), e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<SysMenu> findChildList(List<SysMenu> findList) {
|
|
|
|
|
List<SysMenu> result = new ArrayList<>();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(findList)) {
|
|
|
|
|
for (SysMenu menu : findList) {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(menu.getChildList())) {
|
|
|
|
|
result.addAll(findChildList(menu.getChildList()));
|
|
|
|
|
}
|
|
|
|
|
result.add(menu);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|