Skip to content

Commit f35b5af

Browse files
committed
fix(Embedded Management): The page embed style is incorrect
1 parent eee9286 commit f35b5af

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

frontend/src/views/embedded/page.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ import { nextTick, onBeforeMount, onBeforeUnmount, reactive, ref } from 'vue'
1616
import { useRoute } from 'vue-router'
1717
import { assistantApi } from '@/api/assistant'
1818
import { useAssistantStore } from '@/stores/assistant'
19+
import { useAppearanceStoreWithOut } from '@/stores/appearance'
1920
import { useI18n } from 'vue-i18n'
2021
import { request } from '@/utils/request'
2122
import { setCurrentColor } from '@/utils/utils'
2223
2324
const { t } = useI18n()
2425
const chatRef = ref()
26+
const appearanceStore = useAppearanceStoreWithOut()
2527
const assistantStore = useAssistantStore()
2628
assistantStore.setPageEmbedded(true)
2729
const route = useRoute()
@@ -96,9 +98,7 @@ const registerReady = (assistantId: any) => {
9698
}
9799
98100
const setPageCustomColor = (val: any) => {
99-
const selector =
100-
dynamicType.value === 4 ? '.sqlbot--embedded-page' : '.sqlbot-embedded-assistant-page'
101-
const ele = document.querySelector(selector) as HTMLElement
101+
const ele = document.querySelector('body') as HTMLElement
102102
setCurrentColor(val, ele)
103103
}
104104
@@ -158,6 +158,17 @@ onBeforeMount(async () => {
158158
}
159159
}
160160
161+
if (!rawData.theme) {
162+
const { customColor, themeColor } = appearanceStore
163+
const currentColor =
164+
themeColor === 'custom' && customColor
165+
? customColor
166+
: themeColor === 'blue'
167+
? '#3370ff'
168+
: '#1CBA90'
169+
customSet.theme = currentColor || customSet.theme
170+
}
171+
161172
nextTick(() => {
162173
setPageCustomColor(customSet.theme)
163174
})

0 commit comments

Comments
 (0)