需要先登录才能进入“ /”

问题描述 投票:0回答:1

我用此来更改我的home.route.ts:

export const HOME_ROUTE: Route = {
  path: '',
  component: HomeComponent,
  data: {
    authorities: ['ROLE_USER', 'ROLE_ADMIN'],
    pageTitle: 'home.title'
  },
  canActivate: [UserRouteAccessService]
};

但是,在终端日志中,我每毫秒都会看到大量错误:

2020-04-28 15:01:31.284 DEBUG 3588 --- [ XNIO-1 task-66] c.m.m.r.CustomAuditEventRepository       : Exit: add() with result = null
2020-04-28 15:01:31.285  WARN 3588 --- [ XNIO-1 task-66] o.z.problem.spring.common.AdviceTraits   : Unauthorized: Full authentication is required to access this resource
2020-04-28 15:01:31.286  WARN 3588 --- [ XNIO-1 task-66] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access
 this resource]

访问路径''之前登录的最佳方法是什么?

对不起,我的基本英语,我的第一口语言是法语。

angular typescript jhipster
1个回答
0
投票

最近我在Angular的JHipster应用程序中遇到了类似的情况。

这是由于页面布局中包含的一些组件需要了解用户的信息:导航栏,开发人员功能区,...

默认情况下,JHipster使用登录表单的模式,这意味着该弹出窗口显示在包含我上面提到的布局组件的页面中。

我的解决方案是创建一个登录屏幕,并在/login路径上映射一个简化的布局(例如,没有导航栏。

© www.soinside.com 2019 - 2024. All rights reserved.