You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
4.4 KiB

!function(e){var r={};function n(o){if(r[o])return r[o].exports;var t=r[o]={i:o,l:!1,exports:{}};return e[o].call(t.exports,t,t.exports,n),t.l=!0,t.exports}n.m=e,n.c=r,n.d=function(e,r,o){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)n.d(o,t,function(r){return e[r]}.bind(null,t));return o},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,n){"use strict";n.r(r);var o=function(){try{var e=function(e,r){var n=arguments[1]||window.location.search,o=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=n.substr(n.indexOf("?")+1).match(o);return null!=t?t[2]:""},r=e("cps_key")||e("cpskey")||"";r&&/[0-9a-fA-F]{32}/.test(r)&&OPC_COOKIE.cookieProcess.setCookie("cpskey",r);var n=e("opc_hash_key")||"",o=e("gclid")||e("gclid",document.referrer),t=e("gclsrc")||e("gclsrc",document.referrer),c={},i=Date.now();o&&(c.gclid=o),t&&(c.gclsrc=t),r&&(c.trafficparams_cpskey=r,c.cps_time=i),n&&(c.opc_hash_key=n,c.opc_time=i),Object.keys(c).length>0&&OPC_COOKIE.cookieProcess.setTrafficParams(c)}catch(e){console.log("trafficParams write error")}};var t=function(){var e=new Image;return function(r){e.onload=e.onerror=e.onabort=function(){e.onload=e.onerror=e.onabort=null,e=null},e.src=r}},c=function(){try{var e=[1,2,3,10,60,120,300,600],r=0,n=setInterval(function(){r++,~e.indexOf(r)&&function(e){var r={type:"heartbeat",url:window.location.href,clientDevice:function(){var e=navigator.userAgent;return e.indexOf("Android")>0?"android":e.indexOf("iPhone")>0||e.indexOf("iPad")>0||e.indexOf("iPod")>0?"ios":e.indexOf("SymbianOS")>0||e.indexOf("Windows Phone")>0?"other":"pc"}(),expKey:"heartbeat",expValue:e.heartbeat_time},n=[];for(var o in r)n.push(o+"="+encodeURIComponent(r[o]));var c="//cloud.tencent.com/act/common/report?action=heartbeatReport&t="+Math.random()+"&"+n.join("&");t()(c)}({heartbeat_time:r}),r>=e[e.length-1]&&clearInterval(n)},1e3)}catch(e){console.log(e)}},i=function(){var e="trafficParams",r={path:"/",expires:30,domain:function(){var e="cloud.tencent.com";return-1!==window.location.href.indexOf("qcloud.com")&&(e="qcloud.com"),e}()};function n(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var o in n)e[o]=n[o]}return e}function o(e){var r="";for(var n in e)r+=";"+n,r+="expires"!==n?"="+e[n]:"="+new Date(1*new Date+864e5*parseInt(e[n])).toUTCString();return r}return function(){var t={};function c(e){try{if(void 0===e)throw new Error("cookie的键必传");for(var r="",n=document.cookie?document.cookie.split(";"):[],o=0;o<n.length;o++){var t=(String.prototype.trim?n[o].trim():n[o].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")).split("=");if(e===decodeURIComponent(t[0])){r=t[1];break}}return r}catch(e){console.error(e.message)}}return t.setTrafficParams=function(t,i){try{var a=c(e);if(void 0===t)throw new Error("trafficParams必须传值");if("object"!=typeof t)throw new Error("trafficParams的值必须为对象");var f="";for(var u in t)t.hasOwnProperty(u)&&""!==t[u]&&(f+=u+"="+t[u]+";");var s=function(e,r){for(var n=r.split(";"),o=e.split(";"),t=0;t<o.length;t++){for(var c=-1,i=o[t],a=i.split("=")[0],f=0;f<n.length;f++)n[f].split("=")[0]===a&&(c=f);-1===c?n.push(i):n.splice(c,1,i)}var u=(n=n.filter(function(e){return""!==e})).join(";");return"***$;"+(function(e,r,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-r.length,n)===r}(u,";")?u:u+";")+"$***"}(f,a=decodeURIComponent(a).replace(/(^\*{3}\$)|(\$\*{3}$)/gi,""));if(encodeURIComponent(s).length>500)throw new Error("trafficParams的值的字符个数不能超过500");var l=o(i=n(r,i));return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(s)+l}catch(e){console.error(e.message||"写入trafficParams失败")}},t.getCookie=c,t.setCookie=function(e,t,c){try{var i=JSON.stringify(t);/^[\{\]]/.test(i)&&(t=i);var a=o(c=n(r,c));return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a}catch(e){console.log(e.message||"写入cookie失败")}},t}()};window.OPC_COOKIE={cookieProcess:i()},o(),c()}]);