feat: create login filterPresets

This commit is contained in:
kur0nek-o
2024-04-25 10:24:42 +07:00
parent 54c4d12c4f
commit 0fb6b50272
21 changed files with 1250 additions and 487 deletions

View File

@@ -12,12 +12,7 @@ export const useAuthStore = defineStore('auth', () => {
const password = ref('')
const isLoading = ref(false)
const isLoggedIn = computed(() => token.value !== '')
const filterPresets = {
uid: {
id: 2,
name: 'DISTRIBUSI JAKARTA RAYA'
}
}
const filterPresets: any = ref({})
// define your actions
const login = () => {
@@ -28,13 +23,31 @@ export const useAuthStore = defineStore('auth', () => {
type: 'warning'
})
} else {
// filterPresets.value = {
// uid: {
// id: 2,
// name: 'DISTRIBUSI JAKARTA RAYA'
// },
// up3: {
// id: 4,
// name: 'UP3 MENTENG'
// },
// posko: {
// id: 541101,
// name: 'POSKO MENTENG'
// }
// }
isLoading.value = true
setTimeout(() => {
isLoading.value = false
if (username.value == 'demo' && password.value == 'demo') {
// store token in localStorage
writeData('token', 'secret-token')
writeDataJson('filterPresets', filterPresets)
if (Object.keys(filterPresets.value).length > 0) {
writeDataJson('filterPresets', filterPresets.value)
}
dispatchNotification({
title: 'Berhasil',