...
|
...
|
@@ -115,16 +115,10 @@ watch( |
115
|
115
|
page: 1,
|
116
|
116
|
pageSize: 999999
|
117
|
117
|
})
|
118
|
|
- let threeFilePath = ''
|
119
|
|
- const VITE_GLOB_PROXY: [string, string][] | string = import.meta.env.VITE_GLOB_PROXY
|
|
118
|
+ const { host, protocol } = location
|
|
119
|
+ let threeFilePath = `${protocol}//${host}`
|
|
120
|
+ const VITE_GLOB_API_URL = import.meta.env.VITE_GLOB_API_URL
|
120
|
121
|
const VITE_GLOB_API_URL_PREFIX = import.meta.env.VITE_GLOB_API_URL_PREFIX
|
121
|
|
- try {
|
122
|
|
- const getViteGlobProxy = isArray(JSON.parse(VITE_GLOB_PROXY as unknown as string)) ? JSON.parse(VITE_GLOB_PROXY as unknown as string)[0][1] : VITE_GLOB_PROXY
|
123
|
|
- threeFilePath = getViteGlobProxy
|
124
|
|
- } catch {
|
125
|
|
- // 生产环境是字符串,json parse 报错,直接等于字符串即可
|
126
|
|
- threeFilePath = VITE_GLOB_PROXY as unknown as string
|
127
|
|
- }
|
128
|
122
|
threeJsModels.value = items
|
129
|
123
|
?.filter(filterItem => filterItem.state === 1)
|
130
|
124
|
?.map((modelItem: ChartType) => {
|
...
|
...
|
@@ -141,7 +135,7 @@ watch( |
141
|
135
|
redirectComponent: 'Decorates/Three/Loader',
|
142
|
136
|
isThreeModel: true,
|
143
|
137
|
threeModelContent: modelItem.content,
|
144
|
|
- threeModelFilePath: `${threeFilePath}${VITE_GLOB_API_URL_PREFIX}/3d_component/json/${modelItem.id}/scene.json`
|
|
138
|
+ threeModelFilePath: `${threeFilePath}${VITE_GLOB_API_URL}${VITE_GLOB_API_URL_PREFIX}/3d_component/json/${modelItem.id}/scene.json`
|
145
|
139
|
}
|
146
|
140
|
})
|
147
|
141
|
}
|
...
|
...
|
|