27 lines
378 B
PHP
27 lines
378 B
PHP
<?php
|
|
/**
|
|
* 支持跨域
|
|
* @since 2022-9-23
|
|
* @author
|
|
*/
|
|
|
|
namespace app\admin\behavior;
|
|
|
|
|
|
use think\Config;
|
|
use think\Response;
|
|
|
|
class BuildResponse {
|
|
|
|
/**
|
|
* 跨域处理
|
|
* @param $response
|
|
* @author
|
|
*/
|
|
public function run(Response $response) {
|
|
$header = config('apiBusiness.CROSS_DOMAIN');
|
|
$response->header($header);
|
|
}
|
|
|
|
}
|