取消字典数据加密
This commit is contained in:
@@ -37,6 +37,7 @@ function StreamRequestMiniProgram(url, data = {}, onDataReceived, onError, onCom
|
||||
return new Promise((resolve, reject) => {
|
||||
let buffer = '';
|
||||
let hasReceivedContent = false;
|
||||
let isCompleted = false;
|
||||
|
||||
const requestTask = uni.request({
|
||||
url: config.StreamBaseURl + url,
|
||||
@@ -50,8 +51,11 @@ function StreamRequestMiniProgram(url, data = {}, onDataReceived, onError, onCom
|
||||
enableChunked: true, // 启用分块传输
|
||||
success: (res) => {
|
||||
console.log('📡 Stream request completed');
|
||||
onComplete && onComplete();
|
||||
resolve();
|
||||
if (!isCompleted) {
|
||||
isCompleted = true;
|
||||
onComplete && onComplete();
|
||||
resolve();
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('Stream 请求失败:', err);
|
||||
@@ -181,8 +185,11 @@ function StreamRequestMiniProgram(url, data = {}, onDataReceived, onError, onCom
|
||||
console.log('📄 提取的JSON数据:', jsonData);
|
||||
if (jsonData === "[DONE]") {
|
||||
console.log('✅ 收到结束标记 [DONE]');
|
||||
onComplete && onComplete();
|
||||
resolve();
|
||||
if (!isCompleted) {
|
||||
isCompleted = true;
|
||||
onComplete && onComplete();
|
||||
resolve();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user