java后端已经处理了跨域问题:
response.setHeader("Access-Control-Max-Age","1728000");
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Allow-Credentials", "true");
response.addHeader("Access-Control-Allow-Methods","*"); //使用通配符
response.addHeader("Access-Control-Allow-Headers","*"); //使用通配符
但是H5下uni.uploadFile上传文件还是报错如下:
Access to XMLHttpRequest at 'http://192.168.1.21:8090/yf_jsjd/api_common/upload' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
还需要如何处理,请求帮助。如何再处理这种跨域问题。
0 个回复