Commit 6d27ba4375bf22da042ea0569d27f833633a3a34

Authored by xingyu
1 parent b3913a86

fix: user status error

yudao-ui-admin-vue3/src/views/system/user/index.vue
@@ -138,7 +138,7 @@ const submitForm = async () => { @@ -138,7 +138,7 @@ const submitForm = async () => {
138 } 138 }
139 // 改变用户状态操作 139 // 改变用户状态操作
140 const handleStatusChange = async (row: UserVO) => { 140 const handleStatusChange = async (row: UserVO) => {
141 - const text = row.status === CommonStatusEnum.ENABLE ? '停用' : '启用' 141 + const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
142 ElMessageBox.confirm('确认要"' + text + '""' + row.username + '"用户吗?', t('common.reminder'), { 142 ElMessageBox.confirm('确认要"' + text + '""' + row.username + '"用户吗?', t('common.reminder'), {
143 confirmButtonText: t('common.ok'), 143 confirmButtonText: t('common.ok'),
144 cancelButtonText: t('common.cancel'), 144 cancelButtonText: t('common.cancel'),
@@ -146,9 +146,8 @@ const handleStatusChange = async (row: UserVO) => { @@ -146,9 +146,8 @@ const handleStatusChange = async (row: UserVO) => {
146 }) 146 })
147 .then(async () => { 147 .then(async () => {
148 row.status = 148 row.status =
149 - row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE  
150 - const res = await UserApi.updateUserStatusApi(row.id, row.status)  
151 - console.info(res) 149 + row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.ENABLE : CommonStatusEnum.DISABLE
  150 + await UserApi.updateUserStatusApi(row.id, row.status)
152 ElMessage.success(text + '成功') 151 ElMessage.success(text + '成功')
153 await getList() 152 await getList()
154 }) 153 })
@@ -159,12 +158,10 @@ const handleStatusChange = async (row: UserVO) => { @@ -159,12 +158,10 @@ const handleStatusChange = async (row: UserVO) => {
159 } 158 }
160 // 重置密码 159 // 重置密码
161 const handleResetPwd = (row: UserVO) => { 160 const handleResetPwd = (row: UserVO) => {
162 - ElMessageBox.prompt('请输入"' + row.username + '"的新密码', '提示', { 161 + ElMessageBox.prompt('请输入"' + row.username + '"的新密码', t('common.reminder'), {
163 confirmButtonText: t('common.ok'), 162 confirmButtonText: t('common.ok'),
164 cancelButtonText: t('common.cancel') 163 cancelButtonText: t('common.cancel')
165 }).then(({ value }) => { 164 }).then(({ value }) => {
166 - console.log(row.id)  
167 - console.log(value)  
168 UserApi.resetUserPwdApi(row.id, value).then(() => { 165 UserApi.resetUserPwdApi(row.id, value).then(() => {
169 ElMessage.success('修改成功,新密码是:' + value) 166 ElMessage.success('修改成功,新密码是:' + value)
170 }) 167 })