From c2c7d3c66be938892edaa77d96d8af7f98a66c6d Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期五, 08 十一月 2024 10:57:20 +0800 Subject: [PATCH] 修改样式显示还是隐藏 --- src/utils/request.ts | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index 2e36c56..666feaf 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -132,7 +132,9 @@ return axios.create({ baseURL: MAIN_URL, timeout: 1200000, - headers: { 'Content-Type': 'application/json;charset=utf-8 ' }, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, ...option, }); }; @@ -147,7 +149,6 @@ responseType: 'stream', }); const decoder = new TextDecoder(); -const encoder = new TextEncoder(); const readStream = async (stream: ReadableStream, cb: (value) => void): Promise<any> => { const reader = stream.getReader(); let lastValue = ''; @@ -161,12 +162,11 @@ // const txt = decoder.decode(Uint8Array.from([...lastValue, ...value])); const txt = decoder.decode(value); const txtArr = txt.split('\n'); - txtArr[0] =lastValue+ txtArr[0] + txtArr[0] = lastValue + txtArr[0]; txtArr.forEach((value, index, array) => { // 涓�鑸笉浼氬嚭鐜拌繛缁崲琛岋紝鍙彲鑳芥渶鍚庝竴涓槸鎹㈣ if (index === array.length - 1) { - lastValue =value; - + lastValue = value; } else { const decodeValue = decodeURIComponent(value); fullValue += decodeValue; -- Gitblit v1.9.3