Vue工程给后端上传文件时,如果文件大于1MB时会出现
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
的错误
可以在nginx的配置文件中配置允许的文件大小
server {
listen 9001;
server_name localhost;
# 配置允许的文件大小
client_max_body_size 1024M;
}