y***@163.com
y***@163.com
  • 发布:2021-09-29 10:24
  • 更新:2021-09-29 10:24
  • 阅读:909

H5下uni.uploadFile上传文件报错。

分类:uni-app

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.
还需要如何处理,请求帮助。如何再处理这种跨域问题。

2021-09-29 10:24 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复