fix:privacy

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-01-19 14:47:32 +07:00
parent 9793df1c57
commit 8b26530d52
6 changed files with 120 additions and 12 deletions

View file

@ -4,9 +4,11 @@ import { loadModules } from 'esri-loader'
import axios from 'axios'
import { useCounterMixin } from '@/stores/mixin'
import { useQuasar } from 'quasar'
import { usePrivacyStore } from '@/stores/privacy'
const mixin = useCounterMixin()
const { messageError } = mixin
const privacyStore = usePrivacyStore()
// import type { LocationObject } from '@/interface/index/Main'
const mapElement = ref<HTMLElement | null>(null)
@ -200,6 +202,16 @@ async function initializeMap() {
const locationGranted = ref(false)
// Function to request location permission
const requestLocationPermission = () => {
// privacy
if (!privacyStore.isAccepted) {
$q.notify({
type: 'warning',
message: 'กรุณายอมรับนโยบายคุ้มครองข้อมูลส่วนบุคคลก่อนใช้งานแผนที่',
position: 'top',
})
return
}
if (!navigator.geolocation) {
messageError(
$q,
@ -261,7 +273,10 @@ defineExpose({
})
onMounted(async () => {
await initializeMap()
// privacy
if (privacyStore.isAccepted) {
await initializeMap()
}
})
</script>