PDF转docx,返回的网络路径跨域问题。

Viewed 5

格式转换--》pdf转docx接口,返回的网络路径: http://zhai-platereduction.ks3-cn-beijing.ksyun.com/tmp/layout/pdfwriter/tmp/2024-09-19/abc8e546a5da4f6cb057075877b47e4e.docx?Expires=1726821868&AWSAccessKeyId=AKLThacEYfpQEiYtqqtfXFZP&Signature=BCPUy3dzvtT410qvMlb2vUMvZis=

前端将这个网络路径 ,文件名重命名,下载报错。 Access to fetch at 'http://zhai-platereduction.ks3-cn-beijing.ksyun.com/tmp/layout/pdfwriter/tmp/2024-09-19/fe2c52dc39ae437e91f4aa831d6e60e4.docx?Expires=1726821433&AWSAccessKeyId=AKLThacEYfpQEiYtqqtfXFZP&Signature=I9qNjBnAikWziqKmQdmVFJLWmMc=' from origin 'http://localhost' 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.

wps这边有配置跨域的地方吗?

1 Answers

您好,使用window.open下载文件试试呢

无法修改文件名。 还有个问题,wps这边返回的下载链接,http://zhai-platereduction.ks3-cn-beijing.ksyun.com 开头的域名是固定的,还是变化的?