需要自动加载类
//自动加载类
public function __construct(){
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With');
header("Content-type: text/json; charset=utf-8");
}
//封装传递方法
封装的方法
public function out_succ($data = [], $msg = ""){
$result = [
"code" => 0,
"data" => $data,
"msg" => $msg,
];
$json = json_encode($result);
echo $json;
exit();
}