mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-10-31 22:57:15 +08:00 
			
		
		
		
	fix: 修复新增用户未加密密码的问题
This commit is contained in:
		| @@ -82,6 +82,7 @@ import { Message, type FormInstance, type TreeNodeData } from '@arco-design/web- | ||||
| import { useForm } from '@/hooks' | ||||
| import { useDept, useRole } from '@/hooks/app' | ||||
| import { useWindowSize } from '@vueuse/core' | ||||
| import { encryptByRsa } from '@/utils/encrypt' | ||||
|  | ||||
| const { width } = useWindowSize() | ||||
| const { roleList, getRoleList } = useRole() | ||||
| @@ -166,7 +167,14 @@ const save = async () => { | ||||
|       await updateUser(form, dataId.value) | ||||
|       Message.success('修改成功') | ||||
|     } else { | ||||
|       await addUser(form) | ||||
|       const rawPassword = form.password | ||||
|       if (rawPassword) { | ||||
|         form.password = encryptByRsa(rawPassword) || '' | ||||
|       } | ||||
|       await addUser(form).catch(() => { | ||||
|         form.password = rawPassword | ||||
|         return false | ||||
|       }) | ||||
|       Message.success('新增成功') | ||||
|     } | ||||
|     emit('save-success') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user