【发布时间】:2014-04-27 10:16:15
【问题描述】:
我正在使用带有 grails 和 AngularJS 的 Spring Security REST Api。我用邮递员尝试了 url 请求,它工作正常。它使用使用的 x-auth-token 返回结果。但是我也尝试过使用 AngularJs,但它并没有进一步提出 OPTION 请求。
在这里的第一张图片中,它显示我的请求仅被处理到 OPTION 请求。 在第二张图片中,显示了我在 POSTMAN 中尝试过的内容。它给出了结果并且与 x-auth-token 一起工作得很好。 在第三张图片中,我集成了 spring 安全插件,如下所示。它适用于“api/login”,但进一步失败。 第 4 张图片显示了 OPTION 请求的详细响应,然后它无法进一步。
我已经编写了如下的 grunt connect 方法
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
proxies: [
{
context: '/crm/api',
host: 'localhost',
port: 8080
}
],
livereload: {
options: {
open: true,
base: [
'.tmp',
'<%= yeoman.app %>'
]
}
},
test: {
options: {
port: 9001,
base: [
'.tmp',
'test',
'<%= yeoman.app %>'
]
}
},
dist: {
options: {
base: '<%= yeoman.dist %>'
}
}
}
我还是有同样的错误。
【问题讨论】:
标签: spring angularjs spring-mvc grails spring-security