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