zhangxiaomeng 1 year ago
parent
commit
920e316820
  1. 4
      kcui/src/view/Login.vue
  2. 5
      kcui/src/view/TWInfo.vue

4
kcui/src/view/Login.vue

@ -97,6 +97,10 @@ export default {
} }
doLogin(data).then((res)=>{ doLogin(data).then((res)=>{
if(res.code==200){ 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') this.$router.push('/Mulu')
}else { }else {
console.log("失败") console.log("失败")

5
kcui/src/view/TWInfo.vue

@ -96,7 +96,8 @@ export default {
components: {Foot, headInfo}, components: {Foot, headInfo},
data() { data() {
return { return {
userName: "李明", userName: "",
userType:0,
mulu: [ mulu: [
{id: 0, name: "图文资源", info: "TwInfo"}, {id: 0, name: "图文资源", info: "TwInfo"},
{id: 1, name: "视频资源", info: "SpInfo"}, {id: 1, name: "视频资源", info: "SpInfo"},
@ -169,6 +170,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.userType = localStorage.getItem("type");
this.userName = localStorage.getItem("name");
this.getContentList(); this.getContentList();
} }
} }

Loading…
Cancel
Save