OS:Linuxのx64のUbuntuの16.04エラーガールート
アンギュラバージョンの角度-CLI
- :1.0.0-beta.24
- ノード:7.2.0
- NPM :3.10.9
私はAngular CLIでプロジェクトを作成しましたが、私がページを更新すると、現在のルートが壊れています私のルートのパスでCanActivateを使用すると、私はそれを使用することができず、動作しますが、ルートを保護する必要があります。
これはあなたのapp.routing.tsファイルについてapp.routing.ts
const routes: Routes = [
{ path: '', component: LoginComponent },
{ path: 'reports', component: ReportsComponent, canActivate: [AuthGuard] },
{ path: 'reports/thirds', component: ReportThirdsComponent, canActivate: [AuthGuard] },
{ path: 'reports/profit-loss', component: ReportProfitLossComponent, canActivate: [AuthGuard] },
{ path: 'reports/balance', component: ReportBalanceComponent, canActivate: [AuthGuard] },
];
guard&appモジュールコードを投稿できますか? –