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) { export function userResetPwd(data) {
return request({ return request({
url: "/system/user/resetPwd", url: "/system/user/resetPwd",
method: "post", method: "put",
data:data data:data
}) })
} }

View File

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

View File

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