操作cookie - davy-gan/web GitHub Wiki

function getCookie(key) {
  var m = new RegExp('\\b' + key + '\\=([^;]+)').exec(document.cookie);
  return m ? encodeURIComponent(m[1]) : '';
}

getCookie('ctoken')