首页 > 解决方案 > Oracle Jet,核心路由器 - 重新配置功能

问题描述

在 Oracle Jet APP 中,我试图实现一些基于用户身份验证的资源授权行为,

这个想法是:

这是 AppController 中使用的代码:

let navData = [
    { path: '', redirect: 'login' },
    { path: 'login', detail: { label: 'Login', iconClass: 'oj-ux-ico-information-s' } },        
  ];

  // Router setup
  this.router = new CoreRouter(navData, {
    urlAdapter: new UrlParamAdapter()
  });
        
  this.router.sync();

为了实现这一点,我正在尝试使用基于此 API 的核心路由器的重新配置功能:

https://www.oracle.com/webfolder/technetwork/jet/jsdocs/CoreRouter.html#reconfigure

这样

let routes = [                                
            { path: 'accounts' },
            { path: 'new' },                
        ];                         
          
        this.router.reconfigure(routes, {path: 'accounts'} );
        
        this.router.sync();

不幸的是,我收到以下错误:

“未捕获的 TypeError:this.router.reconfigure 不是函数”

我究竟做错了什么?

谢谢

标签: oracle-jet

解决方案


推荐阅读