我尝试通过执行以下操作在 Ubuntu 20.04 AWS EC2 服务器上安装 nginx:
sudo apt update
sudo apt upgrade
sudo apt install nginx
Run Code Online (Sandbox Code Playgroud)
但是最后一个命令失败了:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages …Run Code Online (Sandbox Code Playgroud) 有些东西让我疯狂; 也许有人可以帮我解决以下问题?:
我正在使用AngularJS 1.2.26(因为需要支持IE8)
我必须调用一些最初为骨干前端构建的后端服务.我设法通过以下方式做到这一点:
$http({
method: 'POST',
url: url,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: this._transformRequest,
data: formData
})
.success(function (data) {
// bla bla not relevant
}).error(function (error) {
// bla bla not relevant
});
Run Code Online (Sandbox Code Playgroud)
现在我尝试使用then函数,因为我发现更多结果,所以我将代码更改为:
$http({
method: 'POST',
url: url,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: this._transformRequest,
data: formData
}).then(
function (response) {
// not relevant
}, function (error) {
// not relevant
});
Run Code Online (Sandbox Code Playgroud)
根据我的说法,理论上这应该与初始实现具有相同的结果,但令我惊讶的是,现在请求在服务器上失败了.在调试时我注意到转换请求函数的结果在成功处理的请求中的两个场景和错误中都会产生非常不同的结果,转换请求的结果如下:
com.bank.token.session = XXXXX&模型=%7B%22relatieRol%22%3A%22AANVRAGER%22%2C%22evaUitgevoerdDat%22%3Anull%2C%22sfhUitgevoerdDat%22%3Anull%2C%22bkrUitgevoerdDat%22%3Anull%2C%22bkrBekendCd %22%3A%22GOED_BEKEND%22%7D
当我使用'then'函数作为处理结果的方式时,transformRequest函数返回以下(错误)结果:
com.bank.token.session = XXXXXXXXXXX型号=%7B%22data%22%3A%7B%22relatieRol%22%3A%22AANVRAGER%22%2C%22evaUitgevoerdDat%22%3Anull%2C%22sfhUitgevoerdDat%22%3Anull%2C%22bkrUitgevoerdDat %22%3Anull%7D%2C%22status%22%3A200%2C%22config%22%3A%7B%22method%22%3A%22POST%22%2C%22transformResponse%22%3A%5Bnull%5D%2C%22url %22%3A%22http%3A%2F%2Flocalhost%2Femployee%2Findex.html%2Ffoo幅%2Fxchannel-FOO安全的portlet%2F1598792178%2Fver%3D2.0%2Fresource%2Fid%3Dfoo-fetch-%2Frparam% 3Dportal%3DfooPortal.wsp%22%2C%22headers%22%3A%7B%22Content型%22%3A%22application%2FX WWW的形式进行了urlencoded%22%2C%22Accept%22%3A%22application%2Fjson% 2C%20text%2Fplain%2C 20%*%*2F%22%7D%2C%22data%22%3A%7B%22com.bank.token.会话%22%3A%22XXXXXXXXXX%22%2C%22model%22%3A%22%7B%5C%22relatieRol%5C%22%3A%5C%22AANVRAGER%5C%22%7D%22%7D%7D%2C% …