Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

encrypt & decrypt api data in localstorage

 async getCategory(){
         await this.$axios.$get("/api/v1/category2")
          .then(resp =>{
            const envryptedObject = AES.encrypt(JSON.stringify(resp),'MYKEY4DEMO');
            localStorage.setItem('envryptedObject', envryptedObject.toString());
			})
        },
        getmenuData(){
        const decrypted2 = AES.decrypt(localStorage.getItem('envryptedObject'), 'MYKEY4DEMO');
        const decryptedObject = decrypted2.toString(enc.Utf8);
        var dataq = JSON.parse(decryptedObject)
        this.menuEntrie = dataq;
        console.warn(this.menuEntrie);				
        },
Comment

PREVIOUS NEXT
Code Example
Javascript :: why browser is not detecting my current position 
Javascript :: textfield extjs retrinjir a 4 caracteres 
Javascript :: autosize a textarea using Prototype 
Javascript :: 1521334061 
Javascript :: Pignose Calender 
Javascript :: This will give Iodoform reaction on the treatment with Na2CO3 and I2: 
Javascript :: CSS overflow table row positioning 
Javascript :: uselazyquery refetch from child 
Javascript :: json to schema javascript 
Javascript :: diagonal difference javascript 
Javascript :: put text inside an object javascript 
Javascript :: mozilla observer onclick 
Javascript :: point towards mouse wick editor 
Javascript :: javascript array game 
Javascript :: modal nodejs 
Javascript :: uppy count files from javascript 
Javascript :: fetch memes from redit from javascript 
Javascript :: javascript empty object check ES5 
Javascript :: react export multiple component from index.js 
Javascript :: only return inner hits from nested objects 
Javascript :: search and delete instances of node_modules in directory 
Javascript :: javascript array get element by index 
Javascript :: createTextFinder matchcase example 
Javascript :: json schema script 
Javascript :: Detect when the BACKSPACE is pressed 
Javascript :: how to send multiple values in event in javascript 
Javascript :: exercice json 
Javascript :: javascript id generator 
Javascript :: date pretty print javascript 
Javascript :: FTP upload local file 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =