我已加密.env文件,现在有一个.env.enc文件。我的团队如何解密呢?加密文件时收到此响应,并将其存储在我的.travis.yml文件中
openssl aes-256-cbc -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv -in .env.enc -out .env -d
Run Code Online (Sandbox Code Playgroud)
我在终端上尝试了这个,我得到了:
iv undefined
Run Code Online (Sandbox Code Playgroud)
我尝试使用travis-cli解密:
travis encrypt-file .env.enc .env -d
Run Code Online (Sandbox Code Playgroud)
我刚得到这个:
key must be 64 characters long and a valid hex number
Run Code Online (Sandbox Code Playgroud)
我用键和四尝试了
travis encrypt-file .env.enc .env -d -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv
Run Code Online (Sandbox Code Playgroud)
我检查了travis env变量是否存在,它们是否:
encrypted_cf94abc85bdc_key=[secure]
encrypted_cf94abc85bdc_iv=[secure]
Run Code Online (Sandbox Code Playgroud) 我试图建立一个动态输入框.当我点击小键盘时,我希望它显示在框中,并将该框限制为一个数字.当它达到极限时,下一个输入将转到下一个框.
我不希望用户能够在输入框上单击并手动输入值,我只是希望他们使用小键盘.输入框是否是一个很好的解决方案?
这是我的代码:
https://jsfiddle.net/Piq9117/dwxt928c/
这段代码将我点击的数字放在所有方框上.如何编写它以便当盒子已有数字时它会转到另一个盒子?
$(function () {
var $passBox = $('input[type="text"]');
var $numpad = $('.numpad');
$numpad.on('click', function () {
var $numValue = $(this).text();
$passBox.val($numValue);
})
});
Run Code Online (Sandbox Code Playgroud) 如何使用.forEach代替for循环?
'use strict';
var score = (function(){
function updateScore() {
for(var i = 0; i < arguments.length; i++) {
this.score += arguments[i];
}// I want to use .forEach here instead of for loop.
return this.score;
}
return {
update: updateScore
}
})();
var soccer = {
name: 'Soccer',
score: 0
}
score.update.apply(soccer, [1,2,3])
console.log(soccer.score)
Run Code Online (Sandbox Code Playgroud)
这将记录6。
我试过了
function updateScore() {
arguments.forEach((args, i) => {
this.score += args[i];
};
return this.score;
};
Run Code Online (Sandbox Code Playgroud)
错误日志:arguments.forEach不是函数