From 45851c99058449a5b7143da94ac52dff35c153a9 Mon Sep 17 00:00:00 2001 From: 18300102974 Date: Thu, 9 Feb 2023 12:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=84=AA=E5=8C=96=E7=99=BB=E9=8C=84=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontEnd/components/NavBar.vue | 42 ++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/FrontEnd/components/NavBar.vue b/FrontEnd/components/NavBar.vue index d91d39b..19bf28b 100644 --- a/FrontEnd/components/NavBar.vue +++ b/FrontEnd/components/NavBar.vue @@ -114,22 +114,20 @@ {{ $auth.$storage.getUniversal("userLastName") }} - {{ $t("Log in/Sign up") }} - +
- {{ $t("Log in/Sign up") }} - +
- {{ $t("Log in/Sign up") }}
@@ -783,8 +781,8 @@ export default { }, }, pictureStatus: { - handler: async function (newVal, oldVal) { - await this.fetchUser(); + handler: function (newVal, oldVal) { + this.fetchUser(); this.$forceUpdate(); }, }, @@ -1054,6 +1052,16 @@ export default { this.$nuxt.refresh(); this.UserInfoPopup = false; }, + toUser(){ + this.$auth.$storage.removeUniversal("authtoken"); + this.$auth.$storage.removeUniversal("userPicture"); + this.$auth.$storage.removeUniversal("userLastName"); + this.$auth.$storage.removeUniversal("userBeforePath"); + this.$router.push(this.localePath("/user")); + this.$auth.logout(); + this.$nuxt.refresh(); + this.UserInfoPopup = false; + } // socialRegister() { // if (this.$auth.loggedIn) { // const jsonPayload =