Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPS Observation App DEPRECATED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPS Observation App DEPRECATED
Commits
582de660
Commit
582de660
authored
4 years ago
by
Bhabesh Bhabani Mukhopadhyay
Browse files
Options
Downloads
Patches
Plain Diff
Remove all local stored data from app on logout
parent
ad27045f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/LoginSystem.vue
+45
-7
45 additions, 7 deletions
src/components/LoginSystem.vue
src/components/Photo.vue
+2
-20
2 additions, 20 deletions
src/components/Photo.vue
with
47 additions
and
27 deletions
src/components/LoginSystem.vue
+
45
−
7
View file @
582de660
...
...
@@ -201,13 +201,51 @@ export default {
}
});
},
handleLogout
()
{
this
.
$root
.
sharedState
.
uuid
=
''
;
// remove global uuid for other (e.g. menu items etc)
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_UUID
);
// remove uuid from storage
this
.
$emit
(
CommonUtil
.
CONST_EVENT_LOGIN_USER_DETAIL
,
''
);
$
(
'
.offcanvas-collapse
'
).
removeClass
(
'
open
'
);
}
handleLogout
()
{
this
.
$root
.
sharedState
.
uuid
=
''
;
// remove global uuid for other (e.g. menu items etc)
/** Remove stored data from app in local system - server data still preserve */
this
.
removeStoredData
();
this
.
$emit
(
CommonUtil
.
CONST_EVENT_LOGIN_USER_DETAIL
,
''
);
$
(
'
.offcanvas-collapse
'
).
removeClass
(
'
open
'
);
},
/** Remove stored data on logout */
removeStoredData
()
{
/* Remove localstorage */
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_OBSERVATION_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_UUID
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_USER_DETAIL
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORE_TIMESTAMP
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_CROP_CATEGORY
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_CROP_ID_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_CROP_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_PEST_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_CROP_PEST_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_IMAGE_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_POI_LIST
);
localStorage
.
removeItem
(
CommonUtil
.
CONST_STORAGE_VISIBILITY_POLYGON
);
/* Remove from IndexedDB */
let
dbRequest
=
null
;
dbRequest
=
indexedDB
.
open
(
CommonUtil
.
CONST_DB_NAME
,
CommonUtil
.
CONST_DB_VERSION
);
dbRequest
.
onsuccess
=
function
(
evt
)
{
let
db
=
evt
.
target
.
result
;
db
.
close
();
}
let
delReq
=
indexedDB
.
deleteDatabase
(
CommonUtil
.
CONST_DB_NAME
);
delReq
.
onerror
=
function
()
{
console
.
log
(
'
could not delete database
'
);
}
delReq
.
onblocked
=
function
()
{
console
.
log
(
'
delete DB not successful because of operation block
'
);
}
}
},
mounted
()
{
...
...
This diff is collapsed.
Click to expand it.
src/components/Photo.vue
+
2
−
20
View file @
582de660
...
...
@@ -424,20 +424,8 @@ export default {
}
dbRequest
.
onsuccess
=
function
(
evt
)
{
let
db
=
evt
.
target
.
result
;
if
(
db
.
objectStoreNames
.
contains
(
This
.
entityName
))
{}
else
{
//observationImage.illustration.fileName
//This.createEntity(db,This.entityName, null);
//This.checkDBUpgrade(dbRequest,This.entityName, null);
let
store
=
db
.
createObjectStore
(
This
.
entityName
,{
keyPath
:
"
1_test.jpg
"
});
console
.
log
(
'
inside else
'
);
}
let
transaction
=
db
.
transaction
([
This
.
entityName
],
'
readwrite
'
);
let
db
=
evt
.
target
.
result
;
let
transaction
=
db
.
transaction
([
This
.
entityName
],
'
readwrite
'
);
let
objectstore
=
transaction
.
objectStore
(
This
.
entityName
);
let
indexStore
=
objectstore
.
index
(
indexName
);
let
keyRange
=
IDBKeyRange
.
only
(
indexValue
);
...
...
@@ -701,12 +689,6 @@ export default {
}
},
mounted
(){
this
.
CONST_URL_DOMAIN
=
CommonUtil
.
CONST_URL_DOMAIN
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment