[文档]
安装使用常见问题 - Q:请求出现 Access to XMLHttpRequest at 'xx'
在 uniapp 前端页面请求时出现类似如下错误
Access to XMLHttpRequest at 'https://example.com/api/mtiku/config' from origin 'http://localhost:20000'
has been blocked by CORS policy: Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
这个通常是由于跨域请求导致的,需要在 http 服务器添加跨域相关头信息。
宝塔服...