3.2K Star 13.2K Fork 6.9K

GVPstylefeng / Guns

 / 详情

[BUG]多语言切换失败

Backlog
Opened this issue  
2021-09-04 16:55

Comments (1)

YOMIGI created任务
YOMIGI set related repository to stylefeng/Guns
YOMIGI changed description
YOMIGI changed title
Expand operation logs

暂时解决办法

@Component
@Aspect
public class GetEffectiveLoginUserBugfix {

    @Pointcut("execution(* cn.stylefeng.roses.kernel.system.modular.user.service.impl.SysUserServiceImpl.getEffectiveLoginUser(..))")
    public void excuteService() {
    }

    @AfterReturning(returning = "loginUser", pointcut = "excuteService()")
    public void doAfterRunning(JoinPoint joinPoint,LoginUser loginUser) {
        String tranLanguageCode = "chinese";
        Object[] obj = joinPoint.getArgs();
        for (Object argItem : obj) {
            if (argItem instanceof LoginUser) {
                LoginUser paramVO = (LoginUser) argItem;
                String tranLanguage = paramVO.getTranLanguageCode();
                if (StringUtils.hasText(tranLanguage)){
                    tranLanguageCode = tranLanguage;
                }
            }
        }
        loginUser.setTranLanguageCode(tranLanguageCode);
    }
}

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(1)
Java
1
https://gitee.com/stylefeng/guns.git
git@gitee.com:stylefeng/guns.git
stylefeng
guns
Guns

Search

233307 c1314fcc 1850385 233305 0212f5e2 1850385