/**
 * Created by user on 2018/6/12.
 */
$.ajaxSetup({
    dataType : 'json',
    type: "POST",
    error:function(res){
        if(res.status=='401'){
            localStorage.removeItem(cfapp.storeItemName);
            location.reload();
        }
        console.log(res);
    }
});

function Encrypt(word,key){
    var srcs = CryptoJS.enc.Utf8.parse(word);
    var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
    return encrypted.toString();
}
function Decrypt(word){
    var decrypt = CryptoJS.AES.decrypt(word, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
    return CryptoJS.enc.Utf8.stringify(decrypt).toString();
}