ajax请求时request加请求头

function testJWT2() {
        $.ajax({
            beforeSend: function(request) {
                                        request.setRequestHeader("jwtToken", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9");
                                    },
            type:"GET",
            url:"/sysUser/indexAjax",
            success:function () {
                alert("success");
            }
        })
    }

你可能感兴趣的:(前端(废弃了))