From cf09538c11865e93ab8de8a5b946c78d9f526a25 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Sun, 11 Jun 2023 21:28:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=A06(Vue)=20=D0=B5=D1=89=D0=B5=20?= =?UTF-8?q?=D1=87=D1=83=D1=82=D1=8C-=D1=87=D1=83=D1=82=D1=8C=20=D0=B1?= =?UTF-8?q?=D0=B5=D0=B7=D0=BE=D0=BF=D0=B0=D1=81=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/vue-project/src/App.vue | 34 +++++++++++++++++- data.mv.db | Bin 90112 -> 90112 bytes .../DataBase/controller/UserController.java | 3 ++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Frontend/vue-project/src/App.vue b/Frontend/vue-project/src/App.vue index 7594bdb..51789cf 100644 --- a/Frontend/vue-project/src/App.vue +++ b/Frontend/vue-project/src/App.vue @@ -5,7 +5,39 @@ components: { Header, Footer - } + }, + data() { + return { + tokenFromServer: undefined, + userFromServer: undefined, + securityError: false, + } + }, + created() { + const self = this + window.addEventListener('storage', function(e){ + console.log(e) + if(e.key === "token") + if(this.tokenFromServer !== e.newValue) { + self.storageSecurity() + } + if(e.key === "user") + if(this.userFromServer !== e.newValue) { + self.storageSecurity() + } + }) + }, + methods: { + storageSecurity(){ + localStorage.clear() + this.$router.push("/login") + this.securityError = true + }, + saveServerData(data){ + this.tokenFromServer = data.token + this.userFromServer = data.user + }, + }, } diff --git a/data.mv.db b/data.mv.db index ebed62dea3fc12a08129a0beacf839d3e5482d74..2149c84bea3e9d98fb1adad5e88462712b57045f 100644 GIT binary patch delta 8547 zcmeHMTWlOx8J@H2Szn9oINtSbZKtu)CSKdKJF|1ySkxtz+ZqUVNwL=|klDGkQCvG0 zyR_vYPNg;=6-e@@U7D%_gy=;TP19AyLt2OnQp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