Merge remote-tracking branch 'origin/dev' into test

yun-zuoyi
汪云昊 5 years ago
commit d53a0a1f58

@ -2,11 +2,10 @@ package cn.estsh.i3plus.core.apiservice.configuration;
import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService; import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
import cn.estsh.i3plus.platform.common.util.CommonConstWords; import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.impp.framework.boot.util.ImppSwitchUtil; import cn.estsh.impp.framework.boot.init.IAppStartSystemInit;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
@ -17,26 +16,23 @@ import org.springframework.stereotype.Component;
* @Modify: * @Modify:
**/ **/
@Component @Component
public class AppStartSystemInit implements CommandLineRunner { public class AppStartSystemInit implements IAppStartSystemInit {
public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG); public static final Logger LOGGER = LoggerFactory.getLogger(CommonConstWords.SYSTEM_LOG);
@Autowired(required = false) @Autowired
private ISystemInitService systemInitService; private ISystemInitService systemInitService;
/**
*
*/
@Override @Override
public void run(String... args) throws Exception { public void systemInit() {
try { try {
if(ImppSwitchUtil.isUnitTestEnv()) {
LOGGER.info("【单元测试环境 跳过初始化...】");
return;
}
LOGGER.info("【IMPP-Core开始加载基础信息...】"); LOGGER.info("【IMPP-Core开始加载基础信息...】");
systemInitService.putAndLoadAll(); systemInitService.putAndLoadAll();
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
} }
} }

@ -11,6 +11,7 @@ import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords; import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.annotation.AnnoIgnoreLog; import cn.estsh.i3plus.pojo.base.annotation.AnnoIgnoreLog;
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords; import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
import cn.estsh.i3plus.pojo.base.bean.BaseThreadLocal;
import cn.estsh.i3plus.pojo.base.bean.ListPager; import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
@ -159,9 +160,12 @@ public class WhiteController extends CoreBaseController {
CommonEnumUtil.USER_LOGIN_STATUS userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.LOGIN_SUCCESS; CommonEnumUtil.USER_LOGIN_STATUS userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.LOGIN_SUCCESS;
try { try {
ValidatorBean.checkNotNull(languageCode,"语言不能为空");
// 设置语言代码
BaseThreadLocal.setData(BaseThreadLocal.LANGUAGE_CODE, languageCode);
ValidatorBean.checkNotNull(loginName,"用户名不能为空"); ValidatorBean.checkNotNull(loginName,"用户名不能为空");
ValidatorBean.checkNotNull(loginPwd,"密码不能为空"); ValidatorBean.checkNotNull(loginPwd,"密码不能为空");
ValidatorBean.checkNotNull(languageCode,"语言不能为空");
int sessionMode = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_SESSION_MODE, CommonConstWords.CONFIG_SESSION_MODE_DEFAULT); int sessionMode = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_SESSION_MODE, CommonConstWords.CONFIG_SESSION_MODE_DEFAULT);
if (sessionMode != CommonEnumUtil.SESSION_MODE.SEIZE.getValue()) { if (sessionMode != CommonEnumUtil.SESSION_MODE.SEIZE.getValue()) {
@ -227,7 +231,7 @@ public class WhiteController extends CoreBaseController {
recordSysUserLog(null, loginName,userLoginStatus.getValue(), ipAddr); recordSysUserLog(null, loginName,userLoginStatus.getValue(), ipAddr);
} }
LOGGER.info("会员{}登陆登录完成 , 登录耗时:{}",loginName,(System.currentTimeMillis() - startTime)); LOGGER.info("会员{}登陆登录完成 ,语言:{} , 登录耗时:{}",loginName,BaseThreadLocal.getThreadLanguageCode(),(System.currentTimeMillis() - startTime));
return result; return result;
} }

@ -283,6 +283,7 @@ public class SystemInitService implements ISystemInitService {
} while (pager.hasNext()); } while (pager.hasNext());
for (Map.Entry<String, Map<String, String>> entry : langSoftMap.entrySet()) { for (Map.Entry<String, Map<String, String>> entry : langSoftMap.entrySet()) {
LOGGER.info("【加载资源】缓存 {} 资源", entry.getKey());
redisRes.putHashMap(entry.getKey(), entry.getValue(),-1); redisRes.putHashMap(entry.getKey(), entry.getValue(),-1);
} }
LOGGER.info("【加载资源】模块资源 已分类缓存完毕"); LOGGER.info("【加载资源】模块资源 已分类缓存完毕");

@ -440,9 +440,9 @@ public class SysUserPasswordUtil {
if(Objects.nonNull(resultBean)){ if(Objects.nonNull(resultBean)){
int num = loginErrorNumberMax - loginErrorNumber; int num = loginErrorNumberMax - loginErrorNumber;
if(num == 0){ if(num == 0){
resultBean.setErrorMsg(resultBean.getErrorMsg() + "密码输入错误。用户已被锁定请联系管理员!"); resultBean.setErrorMsg(LocaleUtils.getLocaleRes("密码输入错误。用户已被锁定请联系管理员!"));
}else{ }else{
resultBean.setErrorMsg(resultBean.getErrorMsg() + "密码输入错误。再输入错误"+ num +"次,用户将被锁定"); resultBean.setErrorMsg(String.format(LocaleUtils.getLocaleRes("密码输入错误。再输入错误 %s 次,用户将被锁定"), num));
} }
} }

Loading…
Cancel
Save