fix: 修复第一次修改密码问题
This commit is contained in:
parent
db839887cf
commit
7b48599e57
@ -37,6 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch } from 'vue'
|
||||||
|
import useStore from '@/stores'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import type { ResetPasswordRequest } from '@/api/type/user'
|
import type { ResetPasswordRequest } from '@/api/type/user'
|
||||||
import userApi from '@/api/user-manage'
|
import userApi from '@/api/user-manage'
|
||||||
@ -44,6 +45,8 @@ import { MsgSuccess } from '@/utils/message'
|
|||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
|
const { user } = useStore()
|
||||||
|
|
||||||
const userFormRef = ref()
|
const userFormRef = ref()
|
||||||
const userForm = ref<any>({
|
const userForm = ref<any>({
|
||||||
password: '',
|
password: '',
|
||||||
@ -113,6 +116,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
userApi.putUserManagePassword(userId.value, userForm.value, loading).then((res) => {
|
userApi.putUserManagePassword(userId.value, userForm.value, loading).then((res) => {
|
||||||
emit('refresh')
|
emit('refresh')
|
||||||
|
user.profile()
|
||||||
MsgSuccess('修改用户密码成功')
|
MsgSuccess('修改用户密码成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user