/*
 * @Author: your name
 * @Date: 2021-04-23 17:21:12
 * @LastEditTime: 2021-04-23 17:21:51
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /react-antd-admin-template/src/utils/crypto.js
 */
//传参加密
// import CryptoJS from 'crypto-js';
var CryptoJS = require("crypto-js");

function encryption(params) {
  let key = CryptoJS.enc.Utf8.parse('&qsh9li1KxZa9la@')
  let iv = CryptoJS.enc.Utf8.parse('&qsh9li1KxZa9la@')
  let srcs = CryptoJS.enc.Utf8.parse(params)
  let result = CryptoJS.AES.encrypt(srcs, key, {
    iv,
    mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7
  }).toString()
  return result
};

export default encryption;