| | |
| | | <!--<span><i class="el-icon-user"></i>{{this.userNames}}</span>--> |
| | | <!--</el-tooltip>--> |
| | | <!--</div>--> |
| | | <div class="btn-fullscreen" @click="dialogFormVisible = true"> |
| | | <el-tooltip effect="dark" :content="`修改密码`" placement="bottom"> |
| | | <i class="el-icon-setting"></i> |
| | | </el-tooltip> |
| | | </div> |
| | | <!-- <div class="btn-fullscreen" @click="dialogFormVisible = true">--> |
| | | <!-- <el-tooltip effect="dark" :content="`修改密码`" placement="bottom">--> |
| | | <!-- <i class="el-icon-setting"></i>--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <el-dialog title="修改密码" :visible.sync="dialogFormVisible"> |
| | | <el-form :model="form"> |
| | | <el-form-item label="原始密码" :label-width="formLabelWidth"> |
| | |
| | | <!-- 用户名下拉菜单 --> |
| | | <el-dropdown class="user-name" trigger="click" @command="handleCommand"> |
| | | <span class="el-dropdown-link"> |
| | | 退出登录 <i class="el-icon-caret-bottom"></i> |
| | | {{loginName}} <i class="el-icon-caret-bottom"></i> |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item divided command="editPassword">修改密码</el-dropdown-item> |
| | | <el-dropdown-item divided command="loginout">退出登录</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {mapMutations} from 'vuex' |
| | | import bus from '../common/bus'; |
| | | export default { |
| | | data() { |
| | |
| | | }, |
| | | computed:{ |
| | | |
| | | username(){ |
| | | let username = this.$byutil.getUser(); |
| | | return username ? username.realName : this.name; |
| | | } |
| | | }, |
| | | created() { |
| | | let username = localStorage.getItem('name') |
| | | this.loginName = username |
| | | }, |
| | | |
| | | methods:{ |
| | | methods:{ |
| | | ...mapMutations([ |
| | | 'CLEAR_ROLELIST' |
| | | ]), |
| | | // 用户名下拉菜单选择事件 |
| | | handleCommand(command) { |
| | | if(command == 'loginout'){ |
| | |
| | | sessionStorage.userRoleNames = '' |
| | | sessionStorage.userGuid = '' |
| | | sessionStorage.userName = '' |
| | | console.log(111); |
| | | this.CLEAR_ROLELIST(); //清空本地权限缓存 |
| | | this.$router.push('/login'); |
| | | // this.$confirm("是否退出登录?", "提示", { |
| | | // confirmButtonText: "确定", |
| | |
| | | // }); |
| | | // localStorage.removeItem('ms_username') |
| | | // this.$router.push('/login'); |
| | | }else if(command == 'editPassword'){ |
| | | this.dialogFormVisible = true |
| | | } |
| | | }, |
| | | // 侧边栏折叠 |
| | |
| | | }, |
| | | url:this.$systemconfig.basePath + '/user/updatePassword ' |
| | | }).then(res => { |
| | | if(res.data.success){ |
| | | if(res.data.code==0){ |
| | | this.form.oldPassword = '' |
| | | this.form.newPassword = '' |
| | | this.form.surePassword = '' |
| | | this.errTishi = '' |
| | | this.$message({message: res.data.message, type: 'success'}); |
| | | this.$message({message:'修改成功', type: 'success'}); |
| | | this.dialogFormVisible = false |
| | | }else{ |
| | | this.$message({message: res.data.message, type: 'false'}); |
| | | this.$message({message: '修改失败', type: 'false'}); |
| | | } |
| | | }) |
| | | } |