1234567891011121314151617181920212223242526272829 |
- /**
- * Created by zack on 2018/1/25.
- */
- import AES from 'crypto-js/aes'
- import CryptoJS from 'crypto-js'
- import MD5 from 'crypto-js/md5'
-
- const AESKey = '!23!LinkCampus->20i7~'
-
- const GlobalAESDeEncryptTool = {
- encrypt(text) {
- return AES.encrypt(text, AESKey).toString()
- },
- decrypt(text) {
- const bytes = AES.decrypt(text, AESKey);
- return bytes.toString(CryptoJS.enc.Utf8)
- }
- }
-
- const GlobalMD5EncryptTool = {
- encrypt(text) {
- return MD5(text) + ''
- }
- }
-
- export {
- GlobalAESDeEncryptTool,
- GlobalMD5EncryptTool
- }
|