取消字典数据加密
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
||||||
baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
|
// baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
|
||||||
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
||||||
|
|
||||||
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
|
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
|
||||||
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶
|
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶
|
||||||
|
|||||||
@@ -580,6 +580,15 @@ function extractSpeechText(markdown) {
|
|||||||
console.log('📝 Input markdown length:', markdown ? markdown.length : 0);
|
console.log('📝 Input markdown length:', markdown ? markdown.length : 0);
|
||||||
console.log('📝 Input markdown preview:', markdown ? markdown.substring(0, 200) + '...' : 'No markdown');
|
console.log('📝 Input markdown preview:', markdown ? markdown.substring(0, 200) + '...' : 'No markdown');
|
||||||
|
|
||||||
|
// 过滤AI推理内容(如DeepSeek的<think>标签)
|
||||||
|
// 这些是AI的内部推理过程,不应朗读给用户
|
||||||
|
let cleanedMarkdown = markdown.replace(/<think>[\s\S]*?<\/think>/g, '').trim();
|
||||||
|
console.log('🧹 After removing think tags, length:', cleanedMarkdown.length);
|
||||||
|
if (cleanedMarkdown.length === 0 && markdown.length > 0) {
|
||||||
|
console.warn('⚠️ 所有内容都是think标签,将使用原始文本');
|
||||||
|
cleanedMarkdown = markdown;
|
||||||
|
}
|
||||||
|
|
||||||
const jobRegex = /``` job-json\s*({[\s\S]*?})\s*```/g;
|
const jobRegex = /``` job-json\s*({[\s\S]*?})\s*```/g;
|
||||||
const jobs = [];
|
const jobs = [];
|
||||||
let match;
|
let match;
|
||||||
@@ -587,7 +596,7 @@ function extractSpeechText(markdown) {
|
|||||||
let firstJobStartIndex = -1;
|
let firstJobStartIndex = -1;
|
||||||
|
|
||||||
// 提取岗位 json 数据及前后位置
|
// 提取岗位 json 数据及前后位置
|
||||||
while ((match = jobRegex.exec(markdown)) !== null) {
|
while ((match = jobRegex.exec(cleanedMarkdown)) !== null) {
|
||||||
const jobStr = match[1];
|
const jobStr = match[1];
|
||||||
try {
|
try {
|
||||||
const job = JSON.parse(jobStr);
|
const job = JSON.parse(jobStr);
|
||||||
@@ -608,12 +617,12 @@ function extractSpeechText(markdown) {
|
|||||||
|
|
||||||
// 提取引导语(第一个 job-json 之前的文字)
|
// 提取引导语(第一个 job-json 之前的文字)
|
||||||
const guideText = firstJobStartIndex > 0 ?
|
const guideText = firstJobStartIndex > 0 ?
|
||||||
markdown.slice(0, firstJobStartIndex).trim() :
|
cleanedMarkdown.slice(0, firstJobStartIndex).trim() :
|
||||||
'';
|
'';
|
||||||
|
|
||||||
// 提取结束语(最后一个 job-json 之后的文字)
|
// 提取结束语(最后一个 job-json 之后的文字)
|
||||||
const endingText = lastJobEndIndex < markdown.length ?
|
const endingText = lastJobEndIndex < cleanedMarkdown.length ?
|
||||||
markdown.slice(lastJobEndIndex).trim() :
|
cleanedMarkdown.slice(lastJobEndIndex).trim() :
|
||||||
'';
|
'';
|
||||||
|
|
||||||
console.log('📝 Guide text:', guideText);
|
console.log('📝 Guide text:', guideText);
|
||||||
|
|||||||
@@ -673,14 +673,15 @@ const scrollToBottom = throttle(function () {
|
|||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
function getGuess() {
|
function getGuess() {
|
||||||
// $api.chatRequest('/guest', { sessionId: chatSessionID.value }, 'POST').then((res) => {
|
$api.chatRequest('/guest', { sessionId: chatSessionID.value }, 'POST').then((res) => {
|
||||||
$api.chatRequest('/guest', undefined, 'POST').then((res) => {
|
|
||||||
console.log('getGuess ---- res:', res);
|
console.log('getGuess ---- res:', res);
|
||||||
guessList.value = res.data;
|
guessList.value = res.data;
|
||||||
showGuess.value = true;
|
showGuess.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
});
|
});
|
||||||
|
}).catch((err) => {
|
||||||
|
console.warn('getGuess 请求失败:', err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,20 +80,20 @@
|
|||||||
name: ""
|
name: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$api.myRequest('/auth/login2/ks',form,'post',10100).then((res) => {
|
// $api.myRequest('/auth/login2/ks',form,'post',10100).then((res) => {
|
||||||
if (res.code=='200') {
|
// if (res.code=='200') {
|
||||||
uni.setStorageSync('Padmin-Token', res.data.access_token)
|
// uni.setStorageSync('Padmin-Token', res.data.access_token)
|
||||||
uni.navigateBack({
|
// uni.navigateBack({
|
||||||
delta:2
|
// delta:2
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}).catch(() => {
|
// }).catch(() => {
|
||||||
uni.hideLoading()
|
// uni.hideLoading()
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
title: '登录失败,请重试'
|
// title: '登录失败,请重试'
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
|
|
||||||
function register() {
|
function register() {
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ const needToEncryptSet = new Set([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const encryptPathPrefixes = [
|
const encryptPathPrefixes = [
|
||||||
'/app/common/',
|
// '/app/common/',
|
||||||
'/app/chat/',
|
'/app/chat/',
|
||||||
'/app/speech/',
|
// '/app/speech/',
|
||||||
'/app/job/',
|
'/app/job/',
|
||||||
'/app/company/',
|
'/app/company/',
|
||||||
'/app/companycontact/',
|
'/app/companycontact/',
|
||||||
@@ -62,6 +62,7 @@ const handleResponseData = (resData) => {
|
|||||||
if (resData?.encrypted) {
|
if (resData?.encrypted) {
|
||||||
const decrypted = sm4Decrypt(config.sm4Config.key, resData.encryptedData);
|
const decrypted = sm4Decrypt(config.sm4Config.key, resData.encryptedData);
|
||||||
resData = JSON.parse(decrypted);
|
resData = JSON.parse(decrypted);
|
||||||
|
console.log('[请求] 解密后数据:', resData);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[请求] 解密失败:', e.message);
|
console.error('[请求] 解密失败:', e.message);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ function StreamRequestMiniProgram(url, data = {}, onDataReceived, onError, onCom
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let buffer = '';
|
let buffer = '';
|
||||||
let hasReceivedContent = false;
|
let hasReceivedContent = false;
|
||||||
|
let isCompleted = false;
|
||||||
|
|
||||||
const requestTask = uni.request({
|
const requestTask = uni.request({
|
||||||
url: config.StreamBaseURl + url,
|
url: config.StreamBaseURl + url,
|
||||||
@@ -50,8 +51,11 @@ function StreamRequestMiniProgram(url, data = {}, onDataReceived, onError, onCom
|
|||||||
enableChunked: true, // 启用分块传输
|
enableChunked: true, // 启用分块传输
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('📡 Stream request completed');
|
console.log('📡 Stream request completed');
|
||||||
|
if (!isCompleted) {
|
||||||
|
isCompleted = true;
|
||||||
onComplete && onComplete();
|
onComplete && onComplete();
|
||||||
resolve();
|
resolve();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('Stream 请求失败:', err);
|
console.error('Stream 请求失败:', err);
|
||||||
@@ -181,8 +185,11 @@ function StreamRequestMiniProgram(url, data = {}, onDataReceived, onError, onCom
|
|||||||
console.log('📄 提取的JSON数据:', jsonData);
|
console.log('📄 提取的JSON数据:', jsonData);
|
||||||
if (jsonData === "[DONE]") {
|
if (jsonData === "[DONE]") {
|
||||||
console.log('✅ 收到结束标记 [DONE]');
|
console.log('✅ 收到结束标记 [DONE]');
|
||||||
|
if (!isCompleted) {
|
||||||
|
isCompleted = true;
|
||||||
onComplete && onComplete();
|
onComplete && onComplete();
|
||||||
resolve();
|
resolve();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user