export function httpErrorHandler(err, req, res, next) {
    console.log("in httpErrorHandler");
    console.log(err);
    //todo 自定义错误编码
    if (err) {
        if (err.message == "您的登录已失效" ) {
            res.success({success:false, msg:err.message, code:501});
            next();
        }
        else if (err.message == "您的账户没有访问权限") {
            res.success({success:false, msg:"非常抱歉，您没有权限，请联系工作人员！", code:502});
            next();
        } else if ( err.message == "token已过期") {
            res.success({success:false, msg:"token失效", code:503});
            next();
        }
        else  {
            res.success({success:false, msg:err.message, code:500});
            next();
        }
    }
}