feat: create login filterPresets
This commit is contained in:
@@ -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',
|
||||
|
Reference in New Issue
Block a user