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(); } }