@yxhl/specter-pui-vtk 1.0.86 → 1.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -196,18 +196,22 @@ const srcWithToken = computed(() => {
|
|
|
196
196
|
const currentImageUrl = computed(() => {
|
|
197
197
|
if (props.imageList.length > 0 && currentIndex.value < props.imageList.length) {
|
|
198
198
|
const currentImage = props.imageList[currentIndex.value];
|
|
199
|
-
if (currentImage
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
199
|
+
if (currentImage) {
|
|
200
|
+
// 支持 imageList 项为字符串(直接是URL)或对象(含 url 属性)
|
|
201
|
+
const url = typeof currentImage === 'string' ? currentImage : currentImage?.url;
|
|
202
|
+
if (url) {
|
|
203
|
+
try {
|
|
204
|
+
// 为图片列表中的图片也添加token
|
|
205
|
+
if (window.$vtk && typeof window.$vtk.storage?.get === 'function') {
|
|
206
|
+
const token = window.$vtk.storage.get('_mis_acis_token');
|
|
207
|
+
return token ? `${url}?stoken=${token}` : url;
|
|
208
|
+
} else {
|
|
209
|
+
const token = localStorage.getItem('_mis_acis_token');
|
|
210
|
+
return token ? `${url}?stoken=${token}` : url;
|
|
211
|
+
}
|
|
212
|
+
} catch (error) {
|
|
213
|
+
return url;
|
|
208
214
|
}
|
|
209
|
-
} catch (error) {
|
|
210
|
-
return currentImage.url;
|
|
211
215
|
}
|
|
212
216
|
}
|
|
213
217
|
}
|