oracle-jet - 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 不是函数”
我究竟做错了什么?
谢谢