forgeplus-react/src/common/Env.js

20 lines
619 B
JavaScript

import CryptoJS from 'crypto-js';
export function isDev() {
return window.location.port === "3007";
}
// const isMobile
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
export function Encrypt(str){
let result = CryptoJS.AES.encrypt(str,CryptoJS.enc.Utf8.parse('59c96c3572ab8cc1'),{
iv:CryptoJS.enc.Utf8.parse('59c96c3572ab8cc1'),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return result.toString();
}