Showing
1 changed file
with
23 additions
and
2 deletions
| @@ -73,6 +73,19 @@ | @@ -73,6 +73,19 @@ | ||
| 73 | }, | 73 | }, |
| 74 | }, | 74 | }, |
| 75 | ]" | 75 | ]" |
| 76 | + :drop-down-actions="[ | ||
| 77 | + { | ||
| 78 | + label: '清除密码', | ||
| 79 | + auth: 'api:yt:user:resetPassword', | ||
| 80 | + icon: 'ant-design:delete-outlined', | ||
| 81 | + color: 'error', | ||
| 82 | + tooltip: '清除密码', | ||
| 83 | + popConfirm: { | ||
| 84 | + title: '是否确认清除密码', | ||
| 85 | + confirm: handleClearPassword.bind(null, record), | ||
| 86 | + }, | ||
| 87 | + }, | ||
| 88 | + ]" | ||
| 76 | /> | 89 | /> |
| 77 | </template> | 90 | </template> |
| 78 | </BasicTable> | 91 | </BasicTable> |
| @@ -100,9 +113,10 @@ | @@ -100,9 +113,10 @@ | ||
| 100 | import { getAuthCache } from '/@/utils/auth'; | 113 | import { getAuthCache } from '/@/utils/auth'; |
| 101 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 114 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 102 | import { deleteTenantAdmin } from '/@/api/tenant/tenantApi'; | 115 | import { deleteTenantAdmin } from '/@/api/tenant/tenantApi'; |
| 103 | - // import { useMessage } from '/@/hooks/web/useMessage'; | 116 | + import { useMessage } from '/@/hooks/web/useMessage'; |
| 104 | 117 | ||
| 105 | import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | 118 | import { USER_INFO_KEY } from '/@/enums/cacheEnum'; |
| 119 | + import { clearUserPassword } from '/@/api/system/system'; | ||
| 106 | 120 | ||
| 107 | const searchInfo = reactive<Recordable>({}); | 121 | const searchInfo = reactive<Recordable>({}); |
| 108 | const go = useGo(); | 122 | const go = useGo(); |
| @@ -111,7 +125,7 @@ | @@ -111,7 +125,7 @@ | ||
| 111 | 125 | ||
| 112 | const userRole: any = getAuthCache(USER_INFO_KEY); | 126 | const userRole: any = getAuthCache(USER_INFO_KEY); |
| 113 | const role: string = userRole?.roles[0]; | 127 | const role: string = userRole?.roles[0]; |
| 114 | - // const { createMessage } = useMessage(); | 128 | + const { createMessage } = useMessage(); |
| 115 | 129 | ||
| 116 | const userInfo = useUserStore(); | 130 | const userInfo = useUserStore(); |
| 117 | const [registerTable, { reload, setProps }] = useTable({ | 131 | const [registerTable, { reload, setProps }] = useTable({ |
| @@ -178,6 +192,13 @@ | @@ -178,6 +192,13 @@ | ||
| 178 | record, | 192 | record, |
| 179 | }); | 193 | }); |
| 180 | }; | 194 | }; |
| 195 | + | ||
| 196 | + const handleClearPassword = async (record: Recordable) => { | ||
| 197 | + const { id } = record; | ||
| 198 | + if (!id) return; | ||
| 199 | + const { message } = await clearUserPassword(id); | ||
| 200 | + createMessage.success(message); | ||
| 201 | + }; | ||
| 181 | // const handleDeleteOrBatchDelete = (record: Recordable) => { | 202 | // const handleDeleteOrBatchDelete = (record: Recordable) => { |
| 182 | // deleteTenantAdmin([record.id]).then(() => { | 203 | // deleteTenantAdmin([record.id]).then(() => { |
| 183 | // createMessage.success('删除成功'); | 204 | // createMessage.success('删除成功'); |