瀏覽代碼

提示90天未改密

Tang 2 年之前
父節點
當前提交
661fcfdcb8
共有 2 個文件被更改,包括 30 次插入2 次删除
  1. 8 0
      src/newApi/systemRemind.js
  2. 22 2
      src/permission.js

+ 8 - 0
src/newApi/systemRemind.js

@@ -39,5 +39,13 @@ export default {
             params: data
         })
     },
+    //检查密码修改时间
+    inquireusercheckPwdTime(data) {
+        return request({
+            url: '/system/user/checkPwdTime',
+            method: 'get',
+            params: data
+        })
+    },
     
 }

+ 22 - 2
src/permission.js

@@ -1,10 +1,11 @@
 import router from './router'
 import store from './store'
-import { Message } from 'element-ui'
+import { MessageBox, Message } from 'element-ui'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
 import methods from '@/utils/methodsTool';
 import { getToken } from '@/utils/auth'
+import $api from "@/api/api"
 
 NProgress.configure({ showSpinner: false })
 
@@ -49,6 +50,9 @@ router.beforeEach((to, from, next) => {
           to.query.TenantId = sessionStorage.TenantId
           next(to)
         } else {
+          if (!to.path.includes('/user/profile')) {
+            checkFunc()
+          }
           next()
         }
       }
@@ -68,7 +72,23 @@ router.beforeEach((to, from, next) => {
     }
   }
 })
-
+function checkFunc() {
+  $api.inquireusercheckPwdTime().then(res => {
+    if (res.data) {
+      MessageBox.confirm('您已90天为修改密码,请前往修改密码', '系统提示', {
+        confirmButtonText: '前往修改',
+        showCancelButton: false,
+        closeOnClickModal: false,
+        closeOnPressEscape: false,
+        showClose: false,
+        type: 'warning'
+      }
+      ).then(() => {
+        location.href = '/user/profile';
+      }).catch(() => { });
+    }
+  })
+}
 router.afterEach(() => {
   NProgress.done()
 })