class Cookie {
constructor() {
}
static get ORDER_TYPE() {
return 'order';
}
currentCookie() {
if ($.cookie(Cookie.ORDER_TYPE) && $.cookie(Cookie.ORDER_TYPE) !== "") {
return JSON.parse($.cookie(Cookie.ORDER_TYPE));
} else {
return this.setCookie({});
}
};
}
function getCount(str, i, counter = 0) {
if (i >= str.length) return counter;
if (['a', 'e', 'i', 'o', 'u'].indexOf(str[i]) != -1) {
return getCount(str, ++i, ++counter)
}
return getCount(str, ++i, counter);
}
var el = document.querySelector('.my-el');
el.remove();
el = null;
var el = document.querySelector('.my-el');
el.remove();
function adBlockNotDetected() {
var s = document.createElement('script');
s.async = 1;
s.src = "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
document.head.appendChild(s);
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-1339685915169539",
enable_page_level_ads: true
});
}
preview(params) {
return new Promise((resolve) => {
this.axios
.post('/api/images/preview', params, {
responseType: 'blob'
})
.then(response => {
console.log('Картинка загружена');
var reader = new window.FileReader();
reader.readAsDataURL(response.data);
reader.onload = function() {
this.$refs.cropper.replace(reader.result);
console.log('Картинка готова')
resolve();
}.bind(this)
})
});
}
transport: 'beacon'
при отправке события document.querySelector('.body').classList.add("test2");
var elements = document.getElementsByClassName("body");
for (var i = 0; i < elements.length; i++) {
elements[i].classList.add("test2");
}
const LoginView = () => import('@/views/Login');
const router = new Router({
base: '/',
mode: 'history',
routes: [
{
path: '/login',
name: 'login',
component: LoginView,
}
],
});
export default router;
import axios from 'axios';
import router from '../router';
const instance = axios.create({ baseURL });
instance.interceptors.response.use(undefined, (error) => {
if (error.response && error.response.status === 401) {
router.replace({
path: '/login',
query: { redirect: router.currentRoute.fullPath },
});
}
return Promise.reject(error.response.data);
});