Skip to content

Commit

Permalink
Merge pull request #1359 from CVEProject/srl-tat-782
Browse files Browse the repository at this point in the history
#782 get cve id from localStorage
  • Loading branch information
athu-tran committed Oct 4, 2022
2 parents 0d6b085 + 8fe7506 commit 02e6d4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default new Vuex.Store({
Object.entries(changed)
.forEach(([name, value]) => {
state[name] = value;
localStorage.setItem(name, JSON.stringify(value));
localStorage.setItem(name, value);
});
},
},
Expand Down
9 changes: 1 addition & 8 deletions src/views/CVERecord/CveJsonView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="cve-json-container">
<h1 class="title">{{this.$store.state.cveId}}</h1>
<h1 class="title">{{localStorage.getItem('cveId')}}</h1>
<JsonTree :raw="JSON.stringify(record, null, 2)"></JsonTree>
</div>
</template>
Expand All @@ -20,20 +20,13 @@ export default ({
};
},
created() {
console.log('CVEJSONView created');
this.getJSon();
},
methods: {
getJSon() {
const isArecord = localStorage.getItem('isArecord');
const recordData = JSON.parse(localStorage.getItem('recordData'));
const idData = JSON.parse(localStorage.getItem('idData'));
console.log('1, ', _.isEmpty(recordData), _.isEmpty(idData));
console.log('2, ', _.isUndefined(isArecord), !_.isUndefined(isArecord));
console.log('3, ', _.isEmpty(recordData), !_.isEmpty(recordData));
console.log('4, ', _.isEmpty(idData), !_.isEmpty(idData));
console.log('recordData ', recordData);
console.log('idData', idData);
if (isArecord === 'undefined' || (_.isEmpty(recordData) && _.isEmpty(idData))) {
this.$router.push('/');
Expand Down

0 comments on commit 02e6d4c

Please sign in to comment.