MUI,ajax error Unexpected token <

  node.js, question

MUI,ajax errorSyntaxError: Unexpected token <

One such error thrown by ajax is What Do You Mean?

**SyntaxError: Unexpected token <
 at Function.parse [as parseJSON] (native)
 at XMLHttpRequest.u.onreadystatechange**

Front-end js

mui.ajax({
                data:accInfo,
                url:"/dologin",
                // contentType: "application/x-www-form-urlencoded;charset=utf-8",//这个头信息的含义?
                type:'POST',
                // timeout:1000,
                dataType:"json",
                success:function(data){
                    console.log("返回成功:\n");
                    console.log(data);
                    if(data=='success'){
                        window.location.href="/alarm2";
                    }else{
                        console.log("登出失败");
                    }
                },
                error:function(xhr, type, errorThrown) {
                    //异常处理;
                console.log(xhr);
                console.log(type);
                **console.log(errorThrown);**//SyntaxError: Unexpected token <
                }
            });


后端js
router.post('/dologin',function(req,res,next){
    var user={
        account:"user",
        password:"pass"
    }
    console.log(req.body);
    if(req.body.account=='user'&&req.body.password=='pass'){
        req.session.userid=req.body.account;
        console.log('成功');
        // res.send("success");
        res.redirect('/alarm2');//跳转
        
    }else{
        console.log('账户或密码错误');
        res.redirect('/');
//        res.send("false")
    }
});

As I already know, it is a json format problem. The foreground defines json but the background returns String. Therefore, there is an error. So just set the data returned from the background to json format