Skip to content

Commit

Permalink
fix: 预览获取响应时, 仅使用纯文本
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Feb 11, 2025
1 parent ca66485 commit c0ad385
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.333",
"version": "2.14.334",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
6 changes: 5 additions & 1 deletion src/views/FilePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ const processedData = ref('')
watchEffect(async () => {
if (url) {
try {
const response = await axios.get(url as string)
const response = await axios.get(url as string, {
responseType: 'text',
transformResponse: [(data) => data],
})
console.log(typeof response.data)
processedData.value = response.data
cmStore.setEditCode('filePreview', processedData.value)
} catch (error) {
Expand Down

0 comments on commit c0ad385

Please sign in to comment.