使用AngularJSHTML 5模式重新加载页面会产生错误的GET请求
return app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix = '!';
$routeProvider.when('/', {
templateUrl: '/views/index.html',
controller: 'indexCtrl'
});
$routeProvider.when('/about',{
templateUrl: '/views/about.html',
controller: 'AboutCtrl'
});$locationProvider.html5modeng-href/#/.
localhost:9000/localhost:9000/about.
localhost:9000/aboutCannot GET /about
Request URL:localhost:9000/aboutRequest Method:GET
localhost:9000//about
Request URL:http://localhost:9000/views/about.html
当我刷新时,如何启用角获取正确的页面?
一只斗牛犬
慕桂英3389331
随时随地看视频慕课网APP