添加跨域
添加服务后台添加
This commit is contained in:
@@ -9,7 +9,7 @@ class Moments extends AdminBase
|
|||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
$list = MomentsServer::getMoments();
|
$list = MomentsServer::getMoments();
|
||||||
var_dump($list);
|
$this->assign('list', $list);
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,12 @@ class MomentsServer
|
|||||||
public static function getMoments()
|
public static function getMoments()
|
||||||
{
|
{
|
||||||
$data = MomentsModel::with([
|
$data = MomentsModel::with([
|
||||||
'getStaff'=>function ($query) {},
|
'getStaff'=>function ($query) {
|
||||||
'getOrder'=>function ($query) {}
|
$query->field('id,name');
|
||||||
|
},
|
||||||
|
'getOrder'=>function ($query) {
|
||||||
|
$query->field('id,order_sn');
|
||||||
|
}
|
||||||
])
|
])
|
||||||
->order('id desc')
|
->order('id desc')
|
||||||
->select();
|
->select();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ use think\Response;
|
|||||||
|
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
|
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
|
||||||
header("Access-Control-Allow-Headers: Content-Type, Authorization");
|
header("Access-Control-Allow-Headers: Content-Type, Authorization, version");
|
||||||
|
|
||||||
class ApiBase extends Controller
|
class ApiBase extends Controller
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user