Angular 2的http请求在新系统上处于挂起/取消状态
我发送http请求如下
this.http.post('/api/login', body) .subscribe( response => { ... }, error=> { ... });
但是在新的系统中,它有待等待,然后有时取消。
加载一次后,再也没有发生在该系统上,并正常工作。 基本上我将所有客户端路由redirect到index.html。 如下:
app.get(['/', '/login', '/dashboard'],function(req, res, next){ res.sendFile(path.join(__dirname,'/../public/index.html')); });
'/', '/login', '/dashboard'
是我客户端的路由。 如下:
@RouteConfig([ { path: '/', redirectTo: ['/Dashboard'] }, { path: '/login', component: Login, as: 'Login' }, { path: '/dashboard', component: Dashboard, as: 'Dashboard' } ])