var desencrypt = function(str){ var cryptokey = cryptojs.enc.utf8.parse('wfjtko9s4elkrpz2jkranzdb') var cryptoiv = cryptojs.enc.utf8.parse('d076d35c'.substr(0, 8)) var encodestr = cryptojs.tripledes.encrypt(str, cryptokey, { iv: cryptoiv, mode: cryptojs.mode.cbc, padding: cryptojs.pad.pkcs7 }) return encodestr.tostring() } var mymessage = new mymessage.message({ /*默认参数,下面为默认项*/ iconfontsize: "26px", //图标大小,默认为20px messagefontsize: "20px", //信息字体大小,默认为12px showtime: 2000, //消失时间,默认为3000 align: "center", //显示的位置类型center,right,left positions: { //放置信息距离周边的距离,默认为10px top: "10px", bottom: "10px", right: "10px", left: "10px" }, message: "这是一条消息", //消息内容,默认为"这是一条消息" type: "normal", //消息的类型,还有success,error,warning等,默认为normal }) var geturlarg = function(name) { var url = window.location.search; // 正则筛选地址栏 var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)") // 匹配目标参数 var result = url.substr(1).match(reg); //返回参数值 return result ? decodeuricomponent(result[2]) : null; } api = { post:function(url,data,callback) { $.ajax({ url: url, method: 'post', data:json.stringify(data), headers:{'jeecms-auth-token':localstorage.getitem('jeecms-auth-token'),'redirect-header':false,'content-type':'application/json'}, success: function (data) { callback(data) }, error: function (xhr, textstatus, errorthrown) { mymessage.add(errorthrown, 'error'); } }) }, get:function(url,data,callback) { $.ajax({ url: url, method: 'get', data:data, headers:{'jeecms-auth-token':localstorage.getitem('jeecms-auth-token'),'redirect-header':false,'content-type':'application/json'}, success: function (result) { callback(result) }, error: function (xhr, textstatus, errorthrown) { mymessage.add(errorthrown, 'error'); } }) }, put:function(url,data,callback) { $.ajax({ url: url, method: 'put', data:json.stringify(data), headers:{'jeecms-auth-token':localstorage.getitem('jeecms-auth-token'),'redirect-header':false,'content-type':'application/json'}, success: function (result) { callback(result) }, error: function (xhr, textstatus, errorthrown) { mymessage.add(errorthrown, 'error'); } }) }, delete:function(url,data,callback) { $.ajax({ url: url, method: 'delete', data:json.stringify(data), headers:{'jeecms-auth-token':localstorage.getitem('jeecms-auth-token'),'redirect-header':false,'content-type':'application/json'}, success: function (result) { callback(result) }, error: function (xhr, textstatus, errorthrown) { mymessage.add(errorthrown, 'error'); } }) } }