我在本地调试post一个放在阿里云的Springboot 做的微服务,然后报 Response for preflight has invalid HTTP status code 403。我在本地写的:
methods: {
loadData(){
console.log("111")
let _this = this;
uni.request({
url:'http://我的阿里云ip地址:9012/member/index/1/3',
data:{},
header:{'content-type':'application/json'},
method:'POST',
success:(res)=>{
console.log(res);
}
})
}
}
```javascript
###### 浏览器报:
General
Request URL:http://119.23.65.11:9012/member/index/1/3
Request Method:OPTIONS
Status Code:403
Remote Address:119.23.65.11:9012
Response Headers
Response Headers
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:*
Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE,PUT
Access-Control-Allow-Origin:*
Allow:GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH
Cache-Control:no-cache, no-store, max-age=0, must-revalidate
Date:Thu, 13 Feb 2020 09:57:52 GMT
Expires:0
Pragma:no-cache
Transfer-Encoding:chunked
X-Content-Type-Options:nosniff
X-Frame-Options:DENY
X-XSS-Protection:1; mode=block
Request Headers
Provisional headers are shown
Access-Control-Request-Headers:content-type
Access-Control-Request-Method:POST
Origin:http://localhost:8081
Referer:http://localhost:8081/
User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1