From 920e3168203ea20652aea6812f213b752a9aeb4a Mon Sep 17 00:00:00 2001 From: zhangxiaomeng <1362468712@qq.com> Date: Wed, 5 Feb 2025 10:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kcui/src/view/Login.vue | 4 ++++ kcui/src/view/TWInfo.vue | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kcui/src/view/Login.vue b/kcui/src/view/Login.vue index 7809294..61cc290 100644 --- a/kcui/src/view/Login.vue +++ b/kcui/src/view/Login.vue @@ -97,6 +97,10 @@ export default { } doLogin(data).then((res)=>{ if(res.code==200){ + if(res.info.userType==1){ + localStorage.setItem("type",res.info.userType) + localStorage.setItem("name",res.info.userName) + } this.$router.push('/Mulu') }else { console.log("失败") diff --git a/kcui/src/view/TWInfo.vue b/kcui/src/view/TWInfo.vue index 42a273b..9eb0c16 100644 --- a/kcui/src/view/TWInfo.vue +++ b/kcui/src/view/TWInfo.vue @@ -96,7 +96,8 @@ export default { components: {Foot, headInfo}, data() { return { - userName: "李明", + userName: "", + userType:0, mulu: [ {id: 0, name: "图文资源", info: "TwInfo"}, {id: 1, name: "视频资源", info: "SpInfo"}, @@ -169,6 +170,8 @@ export default { } }, mounted() { + this.userType = localStorage.getItem("type"); + this.userName = localStorage.getItem("name"); this.getContentList(); } }