From c205de44f60c42dc1fc75b1dab32bbdd971534d9 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 28 十月 2024 16:33:57 +0800
Subject: [PATCH] l

---
 admin/src/components/common/CommonHeader.vue |   52 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/admin/src/components/common/CommonHeader.vue b/admin/src/components/common/CommonHeader.vue
index 19c4196..bae0e5b 100644
--- a/admin/src/components/common/CommonHeader.vue
+++ b/admin/src/components/common/CommonHeader.vue
@@ -31,26 +31,29 @@
       </div>
     </div>
     <!-- 淇敼瀵嗙爜 -->
-    <GlobalAlertWindow title="淇敼瀵嗙爜" :visible.sync="visible.changePwd"
-      :showClose="!userInfo.needChangePwd || userInfo.needChangePwd == '1'"
-      :showCancel="!userInfo.needChangePwd || userInfo.needChangePwd == '1'" @confirm="confirmChangePwd"
-      @close="visible.changePwd = false">
-      <el-form :model="changePwdData.form" ref="changePwdDataForm" :rules="changePwdData.rules">
-        <el-form-item label="鍘熷瀵嗙爜" prop="oldPwd" required>
-          <el-input v-model="changePwdData.form.oldPwd" type="password" placeholder="璇疯緭鍏ュ師濮嬪瘑鐮�" maxlength="30"
-            show-password></el-input>
-        </el-form-item>
-        <el-form-item label="鏂板瘑鐮�" prop="newPwd" required>
-          <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="璇疯緭鍏ユ柊瀵嗙爜锛屽瘑鐮侀渶鍖呭惈瀛楁瘝銆佹暟瀛楀強鐗规畩瀛楃涓殑鑷冲皯涓ょ" maxlength="20"
-            show-password></el-input>
-        </el-form-item>
-        <!-- <div style="font-size: 12px;color:#999999">瀵嗙爜闇�鍖呭惈瀛楁瘝銆佹暟瀛楀強鐗规畩瀛楃涓殑鑷冲皯涓ょ</div> -->
-        <el-form-item label="纭鏂板瘑鐮�" prop="confirmPwd" required>
-          <el-input v-model="changePwdData.form.confirmPwd" type="password" placeholder="璇峰啀娆¤緭鍏ユ柊瀵嗙爜" maxlength="20"
-            show-password></el-input>
-        </el-form-item>
-      </el-form>
-    </GlobalAlertWindow>
+    <template v-if="editPsd">
+      <GlobalAlertWindow title="淇敼瀵嗙爜" :visible.sync="visible.changePwd"
+        :showClose="!userInfo.needChangePwd || userInfo.needChangePwd == '0'"
+        :showCancel="!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-input v-model="changePwdData.form.oldPwd" type="password" placeholder="璇疯緭鍏ュ師濮嬪瘑鐮�" maxlength="30"
+              show-password></el-input>
+          </el-form-item>
+          <el-form-item label="鏂板瘑鐮�" prop="newPwd" required>
+            <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="璇疯緭鍏ユ柊瀵嗙爜锛屽瘑鐮侀渶鍖呭惈瀛楁瘝銆佹暟瀛楀強鐗规畩瀛楃涓殑鑷冲皯涓ょ"
+              maxlength="20" show-password></el-input>
+          </el-form-item>
+          <!-- <div style="font-size: 12px;color:#999999">瀵嗙爜闇�鍖呭惈瀛楁瘝銆佹暟瀛楀強鐗规畩瀛楃涓殑鑷冲皯涓ょ</div> -->
+          <el-form-item label="纭鏂板瘑鐮�" prop="confirmPwd" required>
+            <el-input v-model="changePwdData.form.confirmPwd" type="password" placeholder="璇峰啀娆¤緭鍏ユ柊瀵嗙爜" maxlength="20"
+              show-password></el-input>
+          </el-form-item>
+        </el-form>
+      </GlobalAlertWindow>
+    </template>
+
   </div>
 </template>
 
@@ -72,6 +75,7 @@
     return {
       title: process.env.VUE_APP_TITLE,
       headerNavData: {},
+      editPsd: false,
       visible: {
         // 淇敼瀵嗙爜
         changePwd: false
@@ -109,12 +113,14 @@
     //   return this.$route.meta.title
     // }
   },
+  created() {
+
+  },
   mounted() {
     // console.log('userInfo',this.userInfo);
     if (!this.userInfo.needChangePwd || this.userInfo.needChangePwd == '0') {
-      // this.visible.changePwd = true
+      this.visible.changePwd = true
     }
-
   },
   filters: {
     // 灞曠ず鍚嶇О
@@ -132,6 +138,8 @@
     ...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()

--
Gitblit v1.9.3