Ant-design-pro: post get 请求都没有问题,put请求时能够请求成功但。。。。

Created on 22 Mar 2019  ·  1Comment  ·  Source: ant-design/ant-design-pro

Request URL: http://api.xxx.com/users/3
Request Method: PUT
Status Code: 200 OK
Remote Address: 127.0.0.1:80
Referrer Policy: no-referrer-when-downgrade
Connection: keep-alive
Content-Type: text/html; charset=UTF-8
Date: Fri, 22 Mar 2019 01:30:25 GMT
Server: Tengine/2.2.2
Transfer-Encoding: chunked
X-Powered-By: PHP/7.2.3
Provisional headers are shown
Accept: application/x.xxx.v1+json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkua3phYmMuY29tXC91c2VycyIsImlhdCI6MTU1MzE3NTA4NiwiZXhwIjoxNTUzMjIxODA5LCJuYmYiOjE1NTMyMTgyMDksImp0aSI6IlZoTlhlS2czTWdMVXYzYkciLCJzdWIiOjIsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UwOeSz7G9LVC_f0Wce2XkLAQEN7R6CQE44GWAaGOW5s
Content-Type: application/json; charset=utf-8
Origin: http://localhost:8000
Referer: http://localhost:8000/system/admin
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36
{role: 2}

返回是200 但是报
Access to fetch at 'http://api.xxx.com/users/4' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
post get 不会出现这种问题 请大佬帮忙看下

>All comments

很简单的跨域问题。

Was this page helpful?
0 / 5 - 0 ratings

Related issues

happier2 picture happier2  ·  3Comments

wuyongdec picture wuyongdec  ·  3Comments

cheung1111 picture cheung1111  ·  3Comments

yadongxie150 picture yadongxie150  ·  3Comments

renyi818 picture renyi818  ·  3Comments