深海科学与工程研究所安全巡检系统
祖安之光
2025-10-15 6390fa18f5c2df1158a0d664786797b0e8b2fbf9
src/views/system/user/profile/resetPwd.vue
@@ -18,7 +18,8 @@
<script setup>
import { updateUserPwd } from "@/api/system/user";
import useUserStore from "@/store/modules/user";
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const user = reactive({
@@ -45,7 +46,14 @@
  proxy.$refs.pwdRef.validate(valid => {
    if (valid) {
      updateUserPwd(user.oldPassword, user.newPassword).then(response => {
        proxy.$modal.msgSuccess("修改成功");
        if(response.code == 200){
          proxy.$modal.msgSuccess("密码修改成功,需重新登录");
          setTimeout(()=>{
            userStore.logOut().then(() => {
              location.href = '/index';
            })
          },2000)
        }
      });
    }
  });