|  |  | 
 |  |  |       </div> | 
 |  |  |     </div> | 
 |  |  |     <!-- 修改密码 --> | 
 |  |  |     <template v-if="editPsd"> | 
 |  |  |       <GlobalAlertWindow title="修改密码" :visible.sync="visible.changePwd" | 
 |  |  |         :showClose="!userInfo.needChangePwd || userInfo.needChangePwd == '0'" | 
 |  |  |         :showCancel="!userInfo.needChangePwd || userInfo.needChangePwd == '0'" @confirm="confirmChangePwd" | 
 |  |  |         :showClose="userInfo && (!userInfo.needChangePwd || userInfo.needChangePwd == '0')" | 
 |  |  |         :showCancel="userInfo && (!userInfo.needChangePwd || userInfo.needChangePwd == '0')" @confirm="confirmChangePwd" | 
 |  |  |         @close="visible.changePwd = false"> | 
 |  |  |         <el-form :model="changePwdData.form" ref="changePwdDataForm" :rules="changePwdData.rules"> | 
 |  |  |           <el-form-item label="原始密码" prop="oldPwd" required> | 
 |  |  | 
 |  |  |           </el-form-item> | 
 |  |  |         </el-form> | 
 |  |  |       </GlobalAlertWindow> | 
 |  |  |     </template> | 
 |  |  |  | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | 
 |  |  |     return { | 
 |  |  |       title: process.env.VUE_APP_TITLE, | 
 |  |  |       headerNavData: {}, | 
 |  |  |       editPsd: false, | 
 |  |  |       visible: { | 
 |  |  |         // 修改密码 | 
 |  |  |         changePwd: false | 
 |  |  | 
 |  |  |  | 
 |  |  |   }, | 
 |  |  |   mounted() { | 
 |  |  |     // console.log('userInfo',this.userInfo); | 
 |  |  |     if (!this.userInfo.needChangePwd || this.userInfo.needChangePwd == '0') { | 
 |  |  |     // needChangePwd 0 : 默认密码需要修改,1 不需要 | 
 |  |  |     if (userInfo &&(!this.userInfo.needChangePwd || this.userInfo.needChangePwd == '0')) { | 
 |  |  |       this.visible.changePwd = true | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  | 
 |  |  |     ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo']), | 
 |  |  |     // 修改密码 | 
 |  |  |     changePwd() { | 
 |  |  |       this.$set(this.userInfo, 'needChangePwd', this.$store.state.userInfo.needChangePwd) | 
 |  |  |       this.editPsd = true | 
 |  |  |       this.visible.changePwd = true | 
 |  |  |       this.$nextTick(() => { | 
 |  |  |         this.$refs.changePwdDataForm.resetFields() | 
 |  |  | 
 |  |  |         }) | 
 |  |  |           .then(() => { | 
 |  |  |             this.$tip.apiSuccess('修改成功') | 
 |  |  |             this.$store.commit('setUserInfo', {needChangePwd: 1}) | 
 |  |  |             this.visible.changePwd = false | 
 |  |  |           }) | 
 |  |  |           .catch(e => { |