利用crypto-js加密解密报CryptoJS is not defined等相关错误解决方法

2025年02月01日 建站教程

问题描述:项目开发中需要利用crypto-js实现加密解密,原先用的是crypto-js-4.1.1版本,出现了Uncaught SyntaxError: Unexpected tokenUncaught ReferenceError: CryptoJS is not defined错误!

查找问题:原因是当前测试的浏览器是谷歌46版本,crypto-js代码不兼容导致的!

解决流程:

1、下载了crypto-js-3.1.2版本,原先错误没有了,但是报Uncaught TypeError: Cannot read property ' encrypt' of undefined错误;

2、下载了crypto-js-4.0.0版本,完美兼容!

本文链接:http://so.lmcjl.com/news/22438/

展开阅读全文
相关内容