Skip to content

Commit c0ad385

Browse files
committed
fix: 预览获取响应时, 仅使用纯文本
1 parent ca66485 commit c0ad385

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.14.333",
3+
"version": "2.14.334",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/views/FilePreview.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ const processedData = ref('')
8181
watchEffect(async () => {
8282
if (url) {
8383
try {
84-
const response = await axios.get(url as string)
84+
const response = await axios.get(url as string, {
85+
responseType: 'text',
86+
transformResponse: [(data) => data],
87+
})
88+
console.log(typeof response.data)
8589
processedData.value = response.data
8690
cmStore.setEditCode('filePreview', processedData.value)
8791
} catch (error) {

0 commit comments

Comments
 (0)