From e85da16f59ecf754d292c35fd0edf0dccce7fb8d Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 16 Jan 2023 18:17:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=99=BB=E5=BD=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.vue | 22 ++++++++- src/lib/fetch.js | 4 ++ src/main.js | 2 + src/store.js | 4 +- src/views/login.vue | 108 +++++++++++++++++++++++++++++++++++++------- 5 files changed, 119 insertions(+), 21 deletions(-) diff --git a/src/app.vue b/src/app.vue index 80a372c..592da0c 100644 --- a/src/app.vue +++ b/src/app.vue @@ -1,6 +1,6 @@ @@ -9,11 +9,29 @@ import Header from './components/header.vue' import Footer from './components/footer.vue' export default { - components: { Header, Footer } + components: { Header, Footer }, + + mounted() { + var user = localStorage.getItem('user') + if (user) { + this.$store.user = JSON.parse(user) + } + } }