fix(core):在用户未登录时国际化无效

yun-zuoyi
汪云昊 5 years ago
parent 35b0b7ead4
commit ca5001b531

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

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

Loading…
Cancel
Save