Angular 使用useHash以电子/角度布线:真?

Angular 使用useHash以电子/角度布线:真?,angular,electron,Angular,Electron,我正在电子内部构建一个角度应用程序。。但是我在发送到我的页面时遇到了一个问题——有很多问题,但对我来说没有任何效果 main.js win.loadURL(url.format({ pathname: path.join(__dirname, 'dist/application/index.html'), protocol: 'file:', slashes: true, hash: 'overview' })); 应用程序路由.module.ts: c

我正在电子内部构建一个角度应用程序。。但是我在发送到我的页面时遇到了一个问题——有很多问题,但对我来说没有任何效果

main.js

  win.loadURL(url.format({
    pathname: path.join(__dirname, 'dist/application/index.html'),
    protocol: 'file:',
    slashes: true,
    hash: 'overview'
  }));
应用程序路由.module.ts:

const routes: Routes = [
  {path: "", component: OverviewComponent,},
  {path: "overview", component: OverviewComponent,},
  {path: "account", component: AccountComponent},
  {path: "commerce", component: CommerceComponent},
  {path: "billing", component: BillingComponent},
  { path: '**', redirectTo: '/overview', pathMatch: 'full' }
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {useHash: true})],
  exports: [RouterModule]
})
没有“hash#”标签,一切正常,但我希望我的应用程序以不同的路径启动,但当我尝试时

我得到:

错误:未捕获(承诺中):错误:无法匹配任何路由。URL段:“index.html” 错误:无法匹配任何路由。URL段:“index.html”

我也试过了

<base href="./">