Answers for "encrypt & decrypt api data in localstorage"

0

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);				
        },
Posted by: Guest on July-22-2021

Code answers related to "encrypt & decrypt api data in localstorage"

Browse Popular Code Answers by Language