fix(嵌入式): 上传自定义字体,在添加了 content-path 路径的情况下,div 嵌入数据大屏会提示字体请求不到
This commit is contained in:
parent
ce7cac0d4f
commit
a254cffade
@ -5,8 +5,10 @@ import { uiLoadApi } from '@/api/login'
|
|||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import colorFunctions from 'less/lib/less/functions/color.js'
|
import colorFunctions from 'less/lib/less/functions/color.js'
|
||||||
import colorTree from 'less/lib/less/tree/color.js'
|
import colorTree from 'less/lib/less/tree/color.js'
|
||||||
|
import { useEmbedded } from '@/store/modules/embedded'
|
||||||
import { setTitle } from '@/utils/utils'
|
import { setTitle } from '@/utils/utils'
|
||||||
|
|
||||||
|
const embeddedStore = useEmbedded()
|
||||||
const basePath = import.meta.env.VITE_API_BASEPATH
|
const basePath = import.meta.env.VITE_API_BASEPATH
|
||||||
const baseUrl = basePath + '/appearance/image/'
|
const baseUrl = basePath + '/appearance/image/'
|
||||||
import { isBtnShow } from '@/utils/utils'
|
import { isBtnShow } from '@/utils/utils'
|
||||||
@ -172,7 +174,9 @@ export const useAppearanceStore = defineStore('appearanceStore', {
|
|||||||
}
|
}
|
||||||
fontStyleElement.innerHTML = `@font-face {
|
fontStyleElement.innerHTML = `@font-face {
|
||||||
font-family: '${name}';
|
font-family: '${name}';
|
||||||
src: url(${basePath}/typeface/download/${currentFont.fileTransName});
|
src: url(${
|
||||||
|
embeddedStore.baseUrl ? embeddedStore.baseUrl : basePath
|
||||||
|
}/typeface/download/${currentFont.fileTransName});
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}`
|
}`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user