超管后台 - 调整所有的fetch 请求为后封装的 apiRequest,实现cookie 跨域

This commit is contained in:
柳清爽
2025-04-28 15:39:05 +08:00
parent 0eb629df70
commit 35341335d3
15 changed files with 459 additions and 475 deletions

View File

@@ -6,34 +6,21 @@ use think\Controller;
use think\facade\Env;
use app\common\service\AuthService;
class BaseController extends Controller {
class BaseController extends Controller
{
/**
* 令牌
*
* @var string
*/
protected $token = '';
protected $baseUrl;
protected $authorization = '';
public function __construct() {
public function __construct()
{
parent::__construct();
$this->baseUrl = Env::get('api.wechat_url');
// 允许跨域
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
$this->authorization = AuthService::getSystemAuthorization();
}
}