From bc1da0b7596e27e621971d6cc3470d9ebc32864e Mon Sep 17 00:00:00 2001 From: ZM25XC <78628186+ZM25XC@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:57:10 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E8=A3=81=E5=89=AA=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD=20(#1027)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * perf: 优化用户管理-裁剪图片上传功能 --- src/views/system/user/utils/hook.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/system/user/utils/hook.tsx b/src/views/system/user/utils/hook.tsx index 5cad74de38..1dd74453bf 100644 --- a/src/views/system/user/utils/hook.tsx +++ b/src/views/system/user/utils/hook.tsx @@ -6,6 +6,7 @@ import { zxcvbn } from "@zxcvbn-ts/core"; import { handleTree } from "@/utils/tree"; import { message } from "@/utils/message"; import croppingUpload from "../upload.vue"; +import userAvatar from "@/assets/user.jpg"; import { usePublicHooks } from "../../hooks"; import { addDialog } from "@/components/ReDialog"; import type { PaginationProps } from "@pureadmin/table"; @@ -85,8 +86,8 @@ export function useUser(tableRef: Ref, treeRef: Ref) { ), @@ -370,7 +371,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) { contentRenderer: () => h(croppingUpload, { ref: cropRef, - imgSrc: row.avatar, + imgSrc: row.avatar || userAvatar, onCropper: info => (avatarInfo.value = info) }), beforeSure: done => {