File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 2
2
* @Author : 秦少卫
3
3
* @Date : 2024-04-25 15:30 :54
4
4
* @LastEditors : 秦少卫
5
- * @LastEditTime : 2024-05-11 15: 50 : 32
5
+ * @LastEditTime : 2024-05-11 17: 12 : 21
6
6
* @Description : 我的素材
7
7
-->
8
8
@@ -30,7 +30,7 @@ const isLogin = ref(false);
30
30
const getFileListHandle = () => {
31
31
// 获取素材列表
32
32
getFileList()
33
- .then((res ) => {
33
+ .then(() => {
34
34
isLogin.value = true;
35
35
})
36
36
.catch(() => {
Original file line number Diff line number Diff line change 2
2
* @Author : 秦少卫
3
3
* @Date : 2024-05-11 13:23 :48
4
4
* @LastEditors : 秦少卫
5
- * @LastEditTime : 2024-05-11 16: 51 : 47
5
+ * @LastEditTime : 2024-05-11 17: 33 : 56
6
6
* @Description : 文件名称
7
7
-->
8
8
27
27
import { debounce } from 'lodash-es';
28
28
import useMaterial from '@/hooks/useMaterial';
29
29
import { useRoute } from 'vue-router';
30
+ import useSelect from '@/hooks/select';
30
31
const { getTemplInfo, updataTemplInfo } = useMaterial();
31
32
33
+ const { canvasEditor } = useSelect();
34
+
32
35
const fileName = ref('');
33
36
const route = useRoute();
34
37
const loading = ref(false);
@@ -46,6 +49,18 @@ watch(
46
49
}
47
50
);
48
51
52
+ onMounted(() => {
53
+ if (route?.query?.id) {
54
+ getTemplInfo(route?.query?.id)
55
+ .then((res) => {
56
+ fileName.value = res?.data?.attributes?.name;
57
+ canvasEditor.loadJSON(JSON.stringify(res?.data?.attributes?.json));
58
+ })
59
+ .catch(() => {
60
+ window.location.href = '/';
61
+ });
62
+ }
63
+ });
49
64
const saveTempl = () => {
50
65
loading.value = true;
51
66
updataTemplInfo(route.query.id, fileName.value)
You can’t perform that action at this time.
0 commit comments