From 03c38da7555b69cb598e534c97fa25bd5385701c Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 29 十月 2024 17:55:50 +0800
Subject: [PATCH] 表单定义权限控制和属性权限&&成员管理添加密级&&首页修改密码&&登录判断过期停用修改密码后跳转首页

---
 Source/plt-web/plt-web-ui/src/page/index/top/index.vue |   80 +++++++++++++++++++++------------------
 1 files changed, 43 insertions(+), 37 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/page/index/top/index.vue b/Source/plt-web/plt-web-ui/src/page/index/top/index.vue
index ca8584f..4f38b79 100644
--- a/Source/plt-web/plt-web-ui/src/page/index/top/index.vue
+++ b/Source/plt-web/plt-web-ui/src/page/index/top/index.vue
@@ -27,15 +27,15 @@
           <top-color></top-color>
         </div>
       </el-tooltip>
-<!--      閿欒鏃ュ織-->
-<!--      <el-tooltip v-if="showDebug"-->
-<!--                  :content="logsFlag?$t('navbar.bug'):logsLen+$t('navbar.bugs')"-->
-<!--                  effect="dark"-->
-<!--                  placement="bottom">-->
-<!--        <div class="top-bar__item">-->
-<!--          <top-logs></top-logs>-->
-<!--        </div>-->
-<!--      </el-tooltip>-->
+      <!--      閿欒鏃ュ織-->
+      <!--      <el-tooltip v-if="showDebug"-->
+      <!--                  :content="logsFlag?$t('navbar.bug'):logsLen+$t('navbar.bugs')"-->
+      <!--                  effect="dark"-->
+      <!--                  placement="bottom">-->
+      <!--        <div class="top-bar__item">-->
+      <!--          <top-logs></top-logs>-->
+      <!--        </div>-->
+      <!--      </el-tooltip>-->
       <el-tooltip v-if="showLock"
                   :content="$t('navbar.lock')"
                   effect="dark"
@@ -52,14 +52,14 @@
           <top-theme></top-theme>
         </div>
       </el-tooltip>
-<!--      娑堟伅閫氱煡-->
-<!--      <el-tooltip :content="$t('navbar.notice')"-->
-<!--                  effect="dark"-->
-<!--                  placement="bottom">-->
-<!--        <div class="top-bar__item top-bar__item&#45;&#45;show">-->
-<!--          <top-notice></top-notice>-->
-<!--        </div>-->
-<!--      </el-tooltip>-->
+      <!--      娑堟伅閫氱煡-->
+      <!--      <el-tooltip :content="$t('navbar.notice')"-->
+      <!--                  effect="dark"-->
+      <!--                  placement="bottom">-->
+      <!--        <div class="top-bar__item top-bar__item&#45;&#45;show">-->
+      <!--          <top-notice></top-notice>-->
+      <!--        </div>-->
+      <!--      </el-tooltip>-->
       <el-tooltip :content="$t('navbar.language')"
                   effect="dark"
                   placement="bottom">
@@ -112,8 +112,10 @@
         :visible.sync="passwordVisible"
         append-to-body="true"
         class="avue-dialog"
+        style="margin-top: -15vh"
         title="淇敼瀵嗙爜"
-        width="50%">
+        width="50%"
+        @close="passwordClose">
         <avue-form ref="form" v-model="passwordForm" :option="passwordOption" @submit="submitSwitch"/>
       </el-dialog>
     </div>
@@ -151,14 +153,14 @@
       passwordVisible: false,
       passwordForm: {},
       passwordOption: {
-        submitText:'淇濆瓨',
+        submitText: '淇濆瓨',
         column: [
           {
             label: '鐧婚檰瀵嗙爜',
             prop: 'oldPassword',
             span: 24,
-            labelWidth:"15%",
-            type:'password',
+            labelWidth: "15%",
+            type: 'password',
             rules: [
               {
                 required: true,
@@ -171,8 +173,8 @@
             label: '鏂扮櫥闄嗗瘑鐮�',
             prop: 'password',
             span: 24,
-            labelWidth:"15%",
-            type:'password',
+            labelWidth: "15%",
+            type: 'password',
             rules: [
               {
                 required: true,
@@ -185,8 +187,8 @@
             label: '鏂板瘑鐮佺櫥闄嗙‘璁�',
             prop: 'confirmPassword',
             span: 24,
-            labelWidth:"15%",
-            type:'password',
+            labelWidth: "15%",
+            type: 'password',
             rules: [
               {
                 required: true,
@@ -300,28 +302,33 @@
     },
     submitSwitch(form, done) {
       let userInfo = JSON.parse(localStorage.getItem('saber-userInfo'));
-
       let params = {
-        userOid:userInfo.content.userOid,
-        oldPassword:func.encryptData(form.oldPassword,'daliantan0v0vcip'),
-        password:func.encryptData(form.password,'daliantan0v0vcip'),
-        confirmPassword:func.encryptData(form.confirmPassword,'daliantan0v0vcip'),
+        userName: userInfo.content.userId,
+        oldPassword: func.encryptData(form.oldPassword, 'daliantan0v0vcip'),
+        password: func.encryptData(form.password, 'daliantan0v0vcip'),
+        confirmPassword: func.encryptData(form.confirmPassword, 'daliantan0v0vcip'),
 
       }
-      changePassword(params).then(res =>{
-        if(res.data.code === 200){
+      changePassword(params).then(res => {
+        if (res.data.code === 200) {
           this.$message.success(res.data.msg);
           this.passwordVisible = false;
+          this.$store.dispatch("LogOut").then(() => {
+            resetRouter();
+            this.$router.push({path: "/login"});
+          });
         }
       }).catch(err => {
         console.log(err);
       })
-      // this.$store.dispatch("refreshToken", form).then(() => {
-      //   this.userBox = false;
-      //   this.$router.push({path: "/"});
-      // })
       done();
     },
+
+    // 鍏抽棴淇敼瀵嗙爜瀵硅瘽妗�
+    passwordClose() {
+      this.$refs.form.resetFields();
+    },
+
     logout() {
       this.$confirm(this.$t("logoutTip"), this.$t("tip"), {
         confirmButtonText: this.$t("submitText"),
@@ -329,7 +336,6 @@
         type: "warning"
       }).then(() => {
         this.$store.dispatch("LogOut").then(() => {
-          console.log('123');
           resetRouter();
           this.$router.push({path: "/login"});
         });

--
Gitblit v1.9.3