소스 검색

修改密码后退出重新登录

xusl 2 년 전
부모
커밋
e7cb34f499
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      ui/src/views/sysManager/userManager/profile/resetPwd.vue

+ 9 - 1
ui/src/views/sysManager/userManager/profile/resetPwd.vue

@@ -20,6 +20,7 @@
 import { mapGetters } from 'vuex'
 import {doEncrypt, doDecryptStr,doSign,doVerifySignature,userinfoEncrypt,userinfoDecrypt} from '@/utils/smutil'
 import { debounce } from 'lodash'
+import {removeToken} from "@/utils/auth";
 export default {
   data() {
     const equalToPassword = (rule, value, callback) => {
@@ -131,8 +132,15 @@ export default {
           }
           await this.$axios.post('/sysUserController/updatePassword', param).then((res) => {
             if (res.code==0){
-              this.$message.success('密码修改成功')
               this.pwdReset()
+              this.$message.success('密码修改成功,请重新登录!')
+              this.$axios.post(
+                '/logout',{}
+              ).then((res) => {
+                removeToken()
+                //注销返回自己的登录页
+                this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+              })
             }
             if (res.code==1){
               this.$message.error(res.data)