fix:privacy
This commit is contained in:
parent
9793df1c57
commit
8b26530d52
6 changed files with 120 additions and 12 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue