我只是想通过我的angular网站
http://url.com/credit-card?paymentstatus=success&redirectUrl=http://google.com但是url给了我
Cannot GET /credit-card?paymentstatus=success&redirecturl=http://google.com以下是我的代码
.state('creditcard', {
url: "/credit-card",
templateUrl: "views/credit-card.html",
controller: 'CreditCardCtrl',
controllerAs: 'vm'
})
.state('error', {
url: "/error",
templateUrl: "views/error.html",
controller: 'ErrorCtrl',
controllerAs: 'vm'
});发布于 2017-05-18 09:47:49
要在不通过SPA索引页的情况下访问子路由,您需要实现到每个视图的服务器端重定向。这里有一个ruby示例/解释:How to correct set root route in Rails 4 for AngularJS?
这是因为服务器在收到请求时会查找要将请求定向到的页面/文件夹。为了能够直接访问而不进行重写,直接url应该是
http://url.com/#/credit-card?paymentstatus=success&redirectUrl=http://google.comhttps://stackoverflow.com/questions/44012478
复制相似问题