在给阿里云中上传视频的时候报错,信息如下
Access to XMLHttpRequest at 'http://localhost:9001/eduvod/video/uploadAlyVideo' from origin 'http://localhost:9528' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
element-ui.common.js:25924 POST http://localhost:9001/eduvod/video/uploadAlyVideo net::ERR_FAILED
出现这种问题的原因,要么是跨域,要么是请求地址不对
nginx支持上传视频大小有限制的,在配置文件中http标签中或者server标签中增加文件大小限制
client_max_body_size 20M;//代表客户端最大大小是20M