From 30d908751e5d60fbfae45933e814cf45cca3c8bb Mon Sep 17 00:00:00 2001
From: zengqinglong <1107238436@qq.com>
Date: Fri, 8 Nov 2024 14:07:59 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20inject=20=E5=92=8C?=
=?UTF-8?q?=20provide=20=E7=9A=84=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/clipImage.vue | 1 -
src/components/myMaterial/uploadMaterial.vue | 4 +++-
src/components/previewCurrent.vue | 4 +++-
src/components/replaceImg.vue | 1 -
src/hooks/select.ts | 8 +++++---
src/hooks/useAdmin.js | 4 ++--
src/hooks/useCalculate.js | 4 +++-
src/hooks/useMaterial.js | 3 ++-
src/utils/helper.ts | 11 +++++++++++
src/views/home/index.vue | 17 +++++++++--------
10 files changed, 38 insertions(+), 19 deletions(-)
create mode 100644 src/utils/helper.ts
diff --git a/src/components/clipImage.vue b/src/components/clipImage.vue
index c40abeed..8d8c8d09 100644
--- a/src/components/clipImage.vue
+++ b/src/components/clipImage.vue
@@ -23,7 +23,6 @@ import useSelect from '@/hooks/select';
import { useI18n } from 'vue-i18n';
const update = getCurrentInstance();
-// const canvasEditor = inject('canvasEditor');
const { canvasEditor, isOne } = useSelect();
const { t } = useI18n();
const type = ref('');
diff --git a/src/components/myMaterial/uploadMaterial.vue b/src/components/myMaterial/uploadMaterial.vue
index aacdca9b..0f8e5c2d 100644
--- a/src/components/myMaterial/uploadMaterial.vue
+++ b/src/components/myMaterial/uploadMaterial.vue
@@ -44,8 +44,10 @@
const APP_APIHOST = import.meta.env.APP_APIHOST;
import { getFileList, uploadImg, createdMaterial, removeMaterial } from '@/api/user';
import { Utils } from '@kuaitu/core';
+import { INJECT_CANVAS_EDITOR_KEY } from '@/utils/helper';
+
const { selectFiles } = Utils;
-const canvasEditor = inject('canvasEditor');
+const canvasEditor = inject(INJECT_CANVAS_EDITOR_KEY);
const fileList = ref([]);
const isLogin = ref(false);
diff --git a/src/components/previewCurrent.vue b/src/components/previewCurrent.vue
index d38b3402..53dc404d 100644
--- a/src/components/previewCurrent.vue
+++ b/src/components/previewCurrent.vue
@@ -13,9 +13,11 @@