<template> <div class="index-container"> <!--标题--> <mt-header class="header" title="个人资料"> <div slot="left"> <mt-button icon="back" @click="$router.back(-1)"></mt-button> </div> </mt-header> <div class="listbody"> <mt-cell title="用户名" :value="username"></mt-cell> <mt-cell title="真实姓名" :value="name"></mt-cell> <mt-cell title="所属部门" :value="deptName"></mt-cell> <mt-cell title="手机号" :value="phone"></mt-cell> <!--<mt-cell title="修改密码" is-link to="/resetPwd"></mt-cell>--> </div> <div class="logout-div"> <mt-button type="primary" @click="loginOut">清除缓存</mt-button> </div> </div> </template> <script> import { MyLocalStorage } from 'assets/js/utils' import { LOGIN_FLAG, AD_FLAG, SLIDER_FLAG, USER_ACCOUNT, USER_PWD, TOKEN } from 'assets/js/storageConst' import { RSAencrypt } from '@/utils/security' import { Toast} from 'mint-ui' export default { name: "Information", data(){ return { username: this.$store.getters.username, name: this.$store.getters.name, deptName: this.$store.getters.deptName, phone: this.$store.getters.phone } }, methods:{ loginOut () { MyLocalStorage.Cache.remove(TOKEN) MyLocalStorage.Cache.remove(USER_ACCOUNT) Toast('清除缓存成功') this.$router.push({name: 'index'}) } } } </script> <style lang="stylus" rel="stylesheet/stylus" scoped> .mint-cell-title { margin-left: 5px !important } .logout-div{ position: fixed bottom:5px .mint-button{ width 98vw margin:1vw background-color #1d55c6 } } </style>