fix: user status error

This commit is contained in:
xingyu 2022-07-20 00:05:40 +08:00
parent b3913a86f8
commit 6d27ba4375

View File

@ -138,7 +138,7 @@ const submitForm = async () => {
} }
// //
const handleStatusChange = async (row: UserVO) => { const handleStatusChange = async (row: UserVO) => {
const text = row.status === CommonStatusEnum.ENABLE ? '停用' : '启用' const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
ElMessageBox.confirm('确认要"' + text + '""' + row.username + '"用户吗?', t('common.reminder'), { ElMessageBox.confirm('确认要"' + text + '""' + row.username + '"用户吗?', t('common.reminder'), {
confirmButtonText: t('common.ok'), confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'), cancelButtonText: t('common.cancel'),
@ -146,9 +146,8 @@ const handleStatusChange = async (row: UserVO) => {
}) })
.then(async () => { .then(async () => {
row.status = row.status =
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.ENABLE : CommonStatusEnum.DISABLE
const res = await UserApi.updateUserStatusApi(row.id, row.status) await UserApi.updateUserStatusApi(row.id, row.status)
console.info(res)
ElMessage.success(text + '成功') ElMessage.success(text + '成功')
await getList() await getList()
}) })
@ -159,12 +158,10 @@ const handleStatusChange = async (row: UserVO) => {
} }
// //
const handleResetPwd = (row: UserVO) => { const handleResetPwd = (row: UserVO) => {
ElMessageBox.prompt('请输入"' + row.username + '"的新密码', '提示', { ElMessageBox.prompt('请输入"' + row.username + '"的新密码', t('common.reminder'), {
confirmButtonText: t('common.ok'), confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel') cancelButtonText: t('common.cancel')
}).then(({ value }) => { }).then(({ value }) => {
console.log(row.id)
console.log(value)
UserApi.resetUserPwdApi(row.id, value).then(() => { UserApi.resetUserPwdApi(row.id, value).then(() => {
ElMessage.success('修改成功,新密码是:' + value) ElMessage.success('修改成功,新密码是:' + value)
}) })