| | |
| | | import { Module, Mutation, VuexModule ,Action } from 'vuex-module-decorators'; |
| | | import { Role } from '~/shared/models/enum/Role'; |
| | | import { Selected } from '~/shared/models/quick-filter.model'; |
| | | import { StrictQueryParams } from '~/shared/models/strict-query.model'; |
| | | @Module |
| | | export default class LocalStorage extends VuexModule { |
| | | id_token = localStorage.getItem('id_token'); |
| | |
| | | recommendConsultantItem = localStorage.getItem('recommendConsultantItem'); |
| | | appointmentIdFromMsg = localStorage.getItem('appointmentIdFromMsg'); |
| | | satisfactionIdFromMsg = localStorage.getItem('satisfactionIdFromMsg'); |
| | | notContactAppointmentIdFromMsg = localStorage.getItem('notContactAppointmentIdFromMsg'); |
| | | |
| | | get idToken(): string|null { |
| | | return this.id_token; |
| | |
| | | |
| | | get currentSatisfactionIdFromMsg(): string|null { |
| | | return this.satisfactionIdFromMsg; |
| | | } |
| | | |
| | | get currentNotContactAppointmentIdFromMsg(): string|null { |
| | | return this.notContactAppointmentIdFromMsg; |
| | | } |
| | | |
| | | @Mutation storageIdToken(token: string): void { |
| | |
| | | this.satisfactionIdFromMsg = localStorage.getItem('satisfactionIdFromMsg'); |
| | | } |
| | | |
| | | @Mutation storageNotContactAppointmentIdFromMsg(id: string) { |
| | | localStorage.setItem('notContactAppointmentIdFromMsg', id); |
| | | this.notContactAppointmentIdFromMsg = id; |
| | | } |
| | | |
| | | @Mutation storageClear(): void { |
| | | localStorage.removeItem('myRequests'); |
| | | localStorage.removeItem('userInfo'); |
| | |
| | | this.appointmentIdFromMsg = localStorage.getItem('satisfactionIdFromMsg'); |
| | | } |
| | | |
| | | @Mutation storageClearNotContactAppointmentIdFromMsg() { |
| | | localStorage.removeItem('notContactAppointmentIdFromMsg'); |
| | | this.appointmentIdFromMsg = localStorage.getItem('notContactAppointmentIdFromMsg'); |
| | | } |
| | | |
| | | @Mutation storageStrickQueryItem(queryItem: StrictQueryParams): void { |
| | | localStorage.setItem('recommendConsultantItem', JSON.stringify(queryItem)); |
| | | this.recommendConsultantItem = localStorage.getItem('recommendConsultantItem'); |
| | | } |
| | | |
| | | @Action actionStorageClear(): void { |
| | | this.context.commit("storageClear"); |
| | | } |