在宝塔里的Nginx设置文件内添加

location / {
if ( $request_method = ‘OPTIONS’ ) {
add_header access-control-allow-headers range;
add_header access-control-allow-methods GET,POST,HEAD,OPTIONS;
add_header access-control-allow-origin *;
return 200;
}
add_header access-control-allow-origin *;
}