我想在我的angular应用程序中使用cryptoJS库。我正在使用node并通过一个package.json文件安装所有依赖项
我将我在package.json中的依赖项作为
"dependencies": {
"babel-plugin-transform-es2015-for-of": "^6.6.0",
"babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"crypto-js": "^3.1.9-1",
"lodash": "^4.17.4",
"mocha": "^3.2.0"},并将cryptojs导入为
import CryptoJS from 'crypto-js';我收到以下错误
插件错误获取错误: 404未找到实例化数据源加载数据源加载插件/xxxx- http://localhost:3000/public/plugins/xxxx-simple-json-datasource/datasource.js -json- http://localhost:3000/public/crypto-js /http://localhost:3000/public/plugins/xxxx-simple-json-datasource/datasource.js
发布于 2018-07-03 15:11:33
CryptoJS是一个包,可以根据需要使用它的功能。
试一试
import * as CryptoJS from 'crypto-js';
var encrypted = CryptoJS.AES.encrypt(myString, myPassword);
var decrypted = CryptoJS.AES.decrypt(encrypted, myPassword);
decrypted.toString(CryptoJS.enc.Utf8);https://stackoverflow.com/questions/51144763
复制相似问题