深海科学与工程研究所安全巡检系统
祖安之光
2025-10-15 28b0fd047c39f400802d9d85779d01b18b9d745c
src/views/system/user/profile/resetPwd.vue
@@ -18,7 +18,9 @@
<script setup>
import { updateUserPwd } from "@/api/system/user";
import useUserStore from "@/store/modules/user";
const router = useRouter();
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const user = reactive({
@@ -45,13 +47,20 @@
  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)
        }
      });
    }
  });
};
/** 关闭按钮 */
function close() {
  proxy.$tab.closePage();
  router.push({path: '/saftyCheckMng/dailyCheck'})
};
</script>