This commit is contained in:
iriska-gri committed 2023-09-05 16:07:55 +03:00
commit 8c95bbf909
126 files changed
+16922

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
const str = 'hello';
import {useAccountStore} from '@/store/AccountStore'
import {useAppStore} from '@/store/app'
import { baseURL } from '@/utils/axios-api'
import { axiosApiInstance, clearAxios } from '@/utils/axios-api'
import { useRouter } from 'vue-router'
export function getfromserver(path, reactive){
try{
axiosApiInstance.get(path).then(result => {
reactive.value = result.data})}
catch(e){
console.log(e);
}
}
export function getfromserverfree(path, reactive){
try{
clearAxios.get(path).then(result => {
reactive.value = result.data})}
catch(e){
console.log(e);
}
}
export function checkremote(filecheck){
let tmp = new Image
tmp.src=filecheck
if(tmp.complete){
return filecheck
}
else {return "https://avatars.mds.yandex.net/i?id=e581fbd83b62938eb98e4d1110c176eabdb19946-9181179-images-thumbs&n=13"}
}
export default str;
export function pagecounter(){
const router = useRouter()
const accountStore = useAccountStore()
const appStore = useAppStore()
let postdata = {user__id: "user" in accountStore && "id" in accountStore.user? accountStore.user.id: null, page: router.currentRoute.value.meta.title}
clearAxios.post(`${baseURL}api/watcher/counter/`, postdata).then(result => {
console.log(result.data, 'dfdf')
appStore.countvisitor = result.data})
}