| | |
| | | |
| | | <script setup> |
| | | import { updateUserPwd } from "@/api/system/user"; |
| | | |
| | | import useUserStore from "@/store/modules/user"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const user = reactive({ |
| | |
| | | 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) |
| | | } |
| | | }); |
| | | } |
| | | }); |