Javascript 角度:错误语法错误:";JSON.parse:JSON数据第1行第1列的意外字符;

Javascript 角度:错误语法错误:";JSON.parse:JSON数据第1行第1列的意外字符;,javascript,php,angular,ionic-framework,ionic4,Javascript,Php,Angular,Ionic Framework,Ionic4,霍拉,我对每一份提交的数据的回复都有问题。我已经检查了路由等,但我无法捕捉错误的语法 下面是路由模块 const routes: Routes = [ { path: '', redirectTo: 'customer', pathMatch: 'full' }, { path: 'home', loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)}, { path: '

霍拉,我对每一份提交的数据的回复都有问题。我已经检查了路由等,但我无法捕捉错误的语法

下面是路由模块

const routes: Routes = [
  { path: '', redirectTo: 'customer', pathMatch: 'full' },
  { path: 'home', loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)},
  { path: 'customer', loadChildren: './customer/customer.module#CustomerPageModule' },
  { path: 'addcustomer', loadChildren: './addcustomer/addcustomer.module#AddcustomerPageModule' },
  { path: 'addcustomer/:id/:name/:desc', loadChildren: './addcustomer/addcustomer.module#AddcustomerPageModule' },
  { path: 'show', loadChildren: './show/show.module#ShowPageModule' },
];
班级:

this.postPvdr.postData(body, 'proses-api.php').subscribe(data => {
        this.router.navigateByUrl('/customer');
        console.log('OK');
我试图从
this.router.navigate(['/customer'])更改路由

this.router.navigateByUrl('/customer');
但是,所有这些都不起作用

下面是proses-api.php


你哪里有这个错误?在proses.api.phpbut中的json.parse上写着,我已经检查过了,请上传完整的代码,并告诉我们你在哪里有这个错误,请检查一下关于它结尾的问题。非常感谢。
        include "library/config.php";

        $postjson = json_decode(file_get_contents('php://input'), true);
        $today    = date('Y-m-d');
the next :
        if ($postjson['aksi']=='add')
        {
            $query=mysqli_query($mysqli, "INSERT INTO master_customer SET
            name_customer = '$postjson[name_customer]',
            desc_customer = '$postjson[desc_customer]',
            created_at = '$today'
            ");   

            $idcust = msqli_insert_id($mysqli);

            if($query) $result = json_encode(array('success'=>true, 'customerid'=> $idcust));
            else $result = json_encode(array('succes'=>false));

            echo $result;

*elseif ($postjson['aksi']=='update'){
    $query = mysqli_query($mysqli, "UPDATE master_customer SET
    name_customer='$postjson[name_customer]',
    desc_customer='$postjson[desc_customer]' WHERE customer_id='$postjson[customer_id]'");*
 **it is said the error was here --->**   

if($query) $result = json_encode(array('success'=>true, 'result'=>$data));
        else $result = json_encode(array('success'=>false));

        echo $result;
    }
?>