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 |   84 ++++++++++++++++++++++++++++-------------
 1 files changed, 57 insertions(+), 27 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 49677d6..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,14 +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"
@@ -51,13 +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--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">
@@ -110,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>
@@ -129,6 +133,8 @@
 import topColor from "./top-color";
 import topNotice from './top-notice'
 import topLang from "./top-lang";
+import {changePassword} from "@/api/user"
+import func from "@/util/func";
 
 export default {
   components: {
@@ -147,13 +153,14 @@
       passwordVisible: false,
       passwordForm: {},
       passwordOption: {
-        submitText:'淇濆瓨',
+        submitText: '淇濆瓨',
         column: [
           {
             label: '鐧婚檰瀵嗙爜',
-            prop: 'input',
+            prop: 'oldPassword',
             span: 24,
-            labelWidth:"15%",
+            labelWidth: "15%",
+            type: 'password',
             rules: [
               {
                 required: true,
@@ -164,9 +171,10 @@
           },
           {
             label: '鏂扮櫥闄嗗瘑鐮�',
-            prop: 'input1',
+            prop: 'password',
             span: 24,
-            labelWidth:"15%",
+            labelWidth: "15%",
+            type: 'password',
             rules: [
               {
                 required: true,
@@ -177,9 +185,10 @@
           },
           {
             label: '鏂板瘑鐮佺櫥闄嗙‘璁�',
-            prop: 'input2',
+            prop: 'confirmPassword',
             span: 24,
-            labelWidth:"15%",
+            labelWidth: "15%",
+            type: 'password',
             rules: [
               {
                 required: true,
@@ -270,7 +279,6 @@
   methods: {
     // 淇敼瀵嗙爜
     changePasswordHandler() {
-      console.log('123');
       this.passwordVisible = true;
     },
     handleScreen() {
@@ -293,12 +301,34 @@
       this.userBox = true;
     },
     submitSwitch(form, done) {
-      this.$store.dispatch("refreshToken", form).then(() => {
-        this.userBox = false;
-        this.$router.push({path: "/"});
+      let userInfo = JSON.parse(localStorage.getItem('saber-userInfo'));
+      let params = {
+        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) {
+          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);
       })
       done();
     },
+
+    // 鍏抽棴淇敼瀵嗙爜瀵硅瘽妗�
+    passwordClose() {
+      this.$refs.form.resetFields();
+    },
+
     logout() {
       this.$confirm(this.$t("logoutTip"), this.$t("tip"), {
         confirmButtonText: this.$t("submitText"),

--
Gitblit v1.9.3