Authored by 李奇

yas上报获取uid

Showing 1 changed file with 20 additions and 1 deletions
@@ -110,7 +110,26 @@ @@ -110,7 +110,26 @@
110 return vars; 110 return vars;
111 } 111 }
112 112
113 - var uid = queryString().uid || 0; 113 + function getCookie(Name) {
  114 + var search = Name + "="
  115 + var value = "";
  116 +
  117 + if (document.cookie.length > 0) {
  118 + sd = document.cookie.indexOf(search);
  119 + if (sd!= -1) {
  120 + sd += search.length;
  121 + end = document.cookie.indexOf(";", sd);
  122 + if (end == -1)
  123 + end = document.cookie.length;
  124 + //unescape() 函数可对通过 escape() 编码的字符串进行解码。
  125 + value=unescape(document.cookie.substring(sd, end))
  126 + }
  127 + }
  128 + return value;
  129 + }
  130 +
  131 + var uid = getCookie('uid') || queryString().uid || 0;
  132 +
114 window._ozuid = uid; // 暴露ozuid 133 window._ozuid = uid; // 暴露ozuid
115 if (window._yas) { 134 if (window._yas) {
116 window._yas(1 * new Date(), '2.4.18', 'yohobuy_m', uid, '', ''); 135 window._yas(1 * new Date(), '2.4.18', 'yohobuy_m', uid, '', '');