class ApiInterceptor {
boolean before() {
println "before::::=================="
header( "Access-Control-Allow-Origin","*")// 这里的*注意一下允许所有人调用"http://local.test" )
header( "Access-Control-Allow-Credentials", "true" )
header( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" )
header( "Access-Control-Max-Age", "3600" )
true
}
boolean after() {
true
}
void afterView() {
// no-op
}
}
网友评论