ll
liukangdong
2024-10-29 0bda79a1d5f0de3a1885f13763c516650bc19007
admin/src/components/common/CommonHeader.vue
@@ -31,7 +31,6 @@
      </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"
@@ -52,8 +51,6 @@
          </el-form-item>
        </el-form>
      </GlobalAlertWindow>
    </template>
  </div>
</template>
@@ -75,7 +72,6 @@
    return {
      title: process.env.VUE_APP_TITLE,
      headerNavData: {},
      editPsd: false,
      visible: {
        // 修改密码
        changePwd: false
@@ -117,7 +113,7 @@
  },
  mounted() {
    // console.log('userInfo',this.userInfo);
    // needChangePwd 0 : 默认密码需要修改,1 不需要
    if (!this.userInfo.needChangePwd || this.userInfo.needChangePwd == '0') {
      this.visible.changePwd = true
    }
@@ -138,8 +134,6 @@
    ...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()
@@ -192,6 +186,7 @@
        })
          .then(() => {
            this.$tip.apiSuccess('修改成功')
            this.$store.commit('setUserInfo', {needChangePwd: 1})
            this.visible.changePwd = false
          })
          .catch(e => {