问题:
Access to XMLHttpRequest at 'xxxxx.xxx' from origin 'null' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'xxxxx.xxx' that is not equal to the supplied origin.
解决:
在app目录下找到middeware.php加入以下未注释的代码
<?php
// 全局中间件定义文件
return [
// 跨域请求支持
\think\middleware\AllowCrossDomain::class,
// 全局请求缓存
// \think\middleware\CheckRequestCache::class,
// 多语言加载
// \think\middleware\LoadLangPack::class,
// Session初始化
// \think\middleware\SessionInit::class
];