[英]How can I add this custom object to firebase
目前我遇到错误
使用无效数据调用函数DocumentReference.set()。 不支持的字段值:自定义对象对象(在“密码”字段中找到)
这是我的代码
const inputPasswordField = document.querySelector("#pwrd");
var encrypted = CryptoJS.AES.encrypt(inputPasswordField.value, "Secret");
const PasswordSave = encrypted;
docRef.add({
Password: PasswordSave,
}).then(function(){
console.log("status saved!");
}).catch(function(error){
console.log("got an error",error);
})
CryptoJS.AES.encrypt
创建一个包含加密数据的对象。
声明PasswordSave
如下所示:
const PasswordSave = encrypted.toString();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.