mo 2 年之前
父节点
当前提交
1078ecc195
共有 1 个文件被更改,包括 29 次插入12 次删除
  1. 29 12
      src/layout/components/Navbar.vue

+ 29 - 12
src/layout/components/Navbar.vue

@@ -224,7 +224,14 @@
             <span class="dropdown-text">{{ tenantName }}</span>
             <i style="margin-left: 3px" class="icon_admin_change userSize"></i>
           </el-dropdown-item>
-          <el-dropdown-item @click.native="resetPassWord">
+          <el-dropdown-item
+            @click.native="
+              () => {
+                this.nocloseable = false;
+                resetPassWord();
+              }
+            "
+          >
             <i class="icon_admin_edit userSize"></i>
             <span class="dropdown-text">修改密码</span>
           </el-dropdown-item>
@@ -242,7 +249,15 @@
         </el-dropdown-menu>
       </el-dropdown>
     </div>
-    <el-dialog title="修改密码" width="500px" append-to-body :visible.sync="resetVisible">
+    <el-dialog
+      title="修改密码"
+      width="500px"
+      append-to-body
+      :visible.sync="resetVisible"
+      :show-close="!nocloseable"
+      :close-on-press-escape="false"
+      :close-on-click-modal="false"
+    >
       <el-form
         :model="resetForm"
         label-position="right"
@@ -305,7 +320,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="resetVisible = false">取 消</el-button>
+        <el-button @click="resetVisible = false" v-if="!nocloseable">取 消</el-button>
         <el-button type="primary" @click="submitResetPassWord">确 定</el-button>
       </div>
     </el-dialog>
@@ -407,6 +422,7 @@ export default {
       tenantList: [],
       tenantLogo: tenantConfig.tenantLogo || null,
       noReadNum: 0,
+      nocloseable: false,
     };
   },
 
@@ -443,15 +459,16 @@ export default {
     // });
     console.log(this.$store.getters.pwdflag, "getpwdflag");
     if (this.$store.getters.pwdflag) {
-      this.$confirm("当前账号存在安全风险是否修改密码", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.resetPassWord();
-        })
-        .catch(() => {});
+      // this.$confirm("当前账号存在安全风险是否修改密码", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //   })
+      //   .catch(() => {});
+      this.nocloseable = true;
+      this.resetPassWord();
     }
     this.$bus.$on("getShowNums", (obj) => {
       this.noReadNum = obj;