From 30226ad19ae920b4bc830c5e1a25c06130a74c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com> Date: Tue, 17 May 2022 11:49:45 +0800 Subject: [PATCH] fix: BUG --- src/components/ElEditor.vue | 10 +++++++++- src/store/modules/core/auth.js | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/ElEditor.vue b/src/components/ElEditor.vue index 58e7c72..a09c46b 100644 --- a/src/components/ElEditor.vue +++ b/src/components/ElEditor.vue @@ -80,7 +80,15 @@ const handleReady = () => { unref(editor)?.setHTML(attrs.modelValue || ''); }; - watch(() => attrs.modelValue, handleReady, { immediate: true }); + watch( + () => attrs.modelValue, + (value, old) => { + if (!old) { + handleReady(); + } + }, + { immediate: true } + ); const handleUpdateContent = () => { content.value = unref(editor).getHTML(); }; diff --git a/src/store/modules/core/auth.js b/src/store/modules/core/auth.js index 42ba68c..9671e6a 100644 --- a/src/store/modules/core/auth.js +++ b/src/store/modules/core/auth.js @@ -92,11 +92,11 @@ const actions = { login: async ({ commit, rootGetters }, data) => { let res = await login(data); if (res) { - ElMessage.success('登陆成功'); + ElMessage.success('登录成功'); commit('local/setToken', res.token, { root: true }); router.push(rootGetters['layout/returnUrl']); } else { - ElMessage.error('登陆失败'); + ElMessage.error('登录失败'); } return res; },