@@ -16,12 +16,14 @@ import { nextTick, onBeforeMount, onBeforeUnmount, reactive, ref } from 'vue'
1616import { useRoute } from ' vue-router'
1717import { assistantApi } from ' @/api/assistant'
1818import { useAssistantStore } from ' @/stores/assistant'
19+ import { useAppearanceStoreWithOut } from ' @/stores/appearance'
1920import { useI18n } from ' vue-i18n'
2021import { request } from ' @/utils/request'
2122import { setCurrentColor } from ' @/utils/utils'
2223
2324const { t } = useI18n ()
2425const chatRef = ref ()
26+ const appearanceStore = useAppearanceStoreWithOut ()
2527const assistantStore = useAssistantStore ()
2628assistantStore .setPageEmbedded (true )
2729const route = useRoute ()
@@ -96,9 +98,7 @@ const registerReady = (assistantId: any) => {
9698}
9799
98100const 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