function getLoginstatus() { var name = "client_id="; var ca = document.cookie.split(';'); for(var i=0; i< ca.length; i++) { var c=ca[i].trim(); if (c.indexOf(name)==0) { if(c.substring(name.length,c.length) !="" ){ document.getElementById("not_login_footer").style.display="none !important" ; document.getElementById("login_footer").style.display="block !important" ; }else{ document.getElementById("not_login_footer").style.display="block !important" ; document.getElementById("login_footer").style.display="none !important" ; } } } } function setIsRefreshPage() { localStorage.setItem("is_refresh_page",true); } function refreshPage() { var is_refresh_page=localStorage.getItem("is_refresh_page"); if(is_refresh_page){ return Promise.resolve({}); }else{ return Promise.reject({}); } } function getCustomCoupons(){ var coupon_ids_js = document.getElementById("coupon-id-lists-quick").textContent; if(null || localStorage.getItem("is_refresh_page")){ return Promise.all([fetch('/api/discount-coupon/coupons?ids[]='),fetch('/api/discount-coupon/coupons/received/count',{ method: 'POST', credentials: 'same-origin', body: coupon_ids_js })]).then((res) => { return Promise.all([res[0].json(),res[1].json()]) }).then((data) => { data[0].isLogin = true; return data; }); }else{ return Promise.all([fetch('/api/discount-coupon/coupons?ids[]=')]).then((res) => { return Promise.all([res[0].json()]) }).then((data) => { data[0].isLogin = false; return data; }); } } exportFunction('getLoginstatus', getLoginstatus); exportFunction('setIsRefreshPage', setIsRefreshPage); exportFunction('refreshPage', refreshPage); exportFunction('getCustomCoupons', getCustomCoupons);
Sie haben bereits ein Konto? Anmeldung