This commit is contained in:
Iruka 2025-01-08 12:42:59 +08:00
commit 9377adbb76
3 changed files with 24 additions and 22 deletions

View File

@ -18,7 +18,7 @@ export function updateUserPwd(oldPassword, newPassword) {
export function userResetPwd(data) {
return request({
url: "/system/user/resetPwd",
method: "post",
method: "put",
data:data
})
}

View File

@ -20,6 +20,7 @@
userResetPwd
} from "@/api/system/user"
import store from '@/store'
import plugin from "@/plugins"
export default {
data() {
return {
@ -65,19 +66,20 @@
},
methods: {
submit() {
this.$refs.form.validate().then(res => {
let user = {};
user.userId = store.state.user.user.userId;
user.password = this.user.newPassword;
userResetPwd(user).then(response => {
uni.showToast({
title: '修改成功',
mask: false,
duration: 1000
});
uni.navigateBack();
plugin.modal.confirm("您确定要修改密码吗?").then(res => {
this.$refs.form.validate().then(res => {
let user = {};
user.userId = store.state.user.user.userId;
user.password = this.user.newPassword;
userResetPwd(user).then(response => {
uni.showToast({
title: '修改成功',
mask: false,
duration: 1000
});
uni.navigateBack();
})
})
})
}
}

View File

@ -114,7 +114,7 @@
<script>
import store from "@/store"
import {
updateUserPwd
userResetPwd
} from "@/api/system/user"
import {
checkPermi
@ -315,14 +315,14 @@
return
}
let user = {};
user.userId = selectItem.value.userId;
user.password = userForm.value.passWord;
updateUserPwd(user)
.then(res => {
this.showModal = false;
this.userForm.passWord = null;
plugin.modal.msgSuccess("修改成功!")
})
user.userId = this.selectItem.userId;
user.password = this.userForm.passWord;
userResetPwd(user)
.then(res => {
this.showModal = false;
this.userForm.passWord = null;
plugin.modal.msgSuccess("修改成功!")
})
},
onDeleteClick(userId) {
let ids = [];