如何将jquery引导file upload插件中的自定义标头传递到节点服务器

我想传递一个标记字段和它的值以及file upload操作。 我正在使用Bootstrap文件input插件,但它不像其他默认头一样将自定义标头发送到nodejs服务器。 我已经尝试了下面的代码。 请帮我解决这个问题。

此代码与我的本地Apache服务器与基于PHP的代码正常工作,这个问题只显示在我的nodejs服务器,我使用的是sailsjs。

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.3.1/css/fileinput.css" rel="stylesheet" type="text/css"><br> <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.3.1/js/fileinput.min.js"></script> <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> </head> <body> <input id="file-1" class="file" type="file" multiple data-preview-file-type="any"> <script> $("#file-1").fileinput({ uploadUrl: '#', // you must set a valid URL here else you will get an error allowedFileExtensions : ['jpg', 'png','gif'], overwriteInitial: false, maxFileSize: 1000, maxFilesNum: 10, ajaxSettings: { headers: { 'Token': 'XXX55' } }, }); </script> </body> </html>