没绑定过手机号的 允许会话十次,弹出验证码弹窗
This commit is contained in:
160
index.html
160
index.html
@@ -7,12 +7,11 @@
|
||||
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Expires" content="Thu, 01 Jan 1970 00:00:00 GMT">
|
||||
<meta property=" og:title" content="sata光伏智能体">
|
||||
<meta property="og:description"
|
||||
content="SataBot Agent 是一款由人工智能驱动的光伏场景AI应用程序。SataBot Agent AI 能力基于飒沓自研大模型的 AIGC 服务构建。">
|
||||
<meta property=" og:title" content="飒沓光伏智能体">
|
||||
<meta property="og:description" content="SataBot Agent 是一款由人工智能驱动的光伏场景AI应用程序。">
|
||||
<meta property="og:image" content="http://1.95.137.212:19000/mbzn/16%3A33%3A49123.png">
|
||||
|
||||
<title>sata光伏智能体</title>
|
||||
<title>飒沓光伏智能体</title>
|
||||
<link rel="icon" href="./img/logo.png" type="image/x-icon">
|
||||
<!-- <script src=" https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxopensdk.js"> -->
|
||||
<!-- </script> -->
|
||||
@@ -1745,10 +1744,10 @@
|
||||
if (document.querySelector('.popbox .loading-box')) {
|
||||
document.querySelector('.popbox .loading-box').classList.add('none');
|
||||
}
|
||||
userId = res.userId;
|
||||
setCookie('token', res.token);
|
||||
// userId = res.userId;
|
||||
// setCookie('token', res.token);
|
||||
unshowpop();
|
||||
getSessionList();
|
||||
// getSessionList();
|
||||
}
|
||||
|
||||
// } else {
|
||||
@@ -2408,6 +2407,8 @@
|
||||
})
|
||||
return null;
|
||||
});
|
||||
|
||||
console.log(res, 7665)
|
||||
if (!res) {
|
||||
|
||||
|
||||
@@ -2423,6 +2424,24 @@
|
||||
|
||||
return null;
|
||||
}
|
||||
if (res.status === 400) {
|
||||
clearInterval(interval);
|
||||
if (controller) {
|
||||
controller.abort();
|
||||
controller = null;
|
||||
}
|
||||
if (sendBtnImg.classList.contains("none")) {
|
||||
sendBtnImg.classList.remove('none');
|
||||
|
||||
}
|
||||
stopBtn.forEach(e => {
|
||||
if (!e.classList.contains("none")) {
|
||||
e.classList.add('none')
|
||||
}
|
||||
})
|
||||
showpop();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sendParam.imageBase64 = '';
|
||||
@@ -2478,6 +2497,28 @@
|
||||
})
|
||||
// renderChatList();
|
||||
msgDiv.innerHTML = marked.parse(aiMsg.content);
|
||||
// const shareSpan = document.createElement("span");
|
||||
// shareSpan.style.display = "inline-flex";
|
||||
// shareSpan.style.alignItems = "center";
|
||||
// shareSpan.style.cursor = "pointer";
|
||||
// shareSpan.style.marginTop = "8px";
|
||||
// shareSpan.style.opacity = "0.75";
|
||||
// shareSpan.style.transition = "opacity .2s";
|
||||
// shareSpan.title = "分享";
|
||||
|
||||
// shareSpan.onmouseenter = () => shareSpan.style.opacity = "1";
|
||||
// shareSpan.onmouseleave = () => shareSpan.style.opacity = "0.75";
|
||||
|
||||
// shareSpan.innerHTML = `
|
||||
// <svg t="1764059839985" class="icon" viewBox="0 0 1236 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5667" width="20" height="20"><path d="M741.743 1018.343c-28.287 0-50.917-11.315-73.547-28.288-22.63-22.63-39.602-50.917-39.602-84.862V792.044c-124.464 0-328.133 33.945-435.624 181.039-16.973 28.287-56.575 45.26-90.52 50.917H85.478C28.903 1012.685-5.042 961.768 0.616 905.193c28.287-243.27 113.15-418.652 260.243-537.458 107.492-84.862 231.956-130.122 367.735-141.437V118.807c0-50.917 22.63-96.177 67.89-113.15C736.086-5.657 781.345 0 815.29 33.945l362.077 367.735c28.288 22.63 45.26 56.574 50.918 96.176 5.657 39.603-5.658 79.205-33.945 107.492-5.658 5.658-11.315 16.972-22.63 22.63l-350.762 356.42c-22.63 22.63-50.918 33.945-79.205 33.945z m-90.52-339.448h90.52v226.298l356.42-367.734 5.658-5.658c5.657-5.657 5.657-16.972 5.657-22.63 0-11.315-5.657-16.972-11.315-22.63l-5.657-5.657-356.42-362.077V333.79l-79.205 5.658c-118.806 0-231.956 39.602-328.132 113.149-113.15 90.519-186.696 237.613-209.326 429.967 141.436-175.382 390.364-203.669 531.8-203.669z" p-id="5668"></path></svg>
|
||||
// `;
|
||||
|
||||
// shareSpan.onclick = () => {
|
||||
// generatePoster(aiMsg.content);
|
||||
// };
|
||||
|
||||
// if (role === "assistant") {
|
||||
// 分享按钮
|
||||
const shareSpan = document.createElement("span");
|
||||
shareSpan.style.display = "inline-flex";
|
||||
shareSpan.style.alignItems = "center";
|
||||
@@ -2491,74 +2532,49 @@
|
||||
shareSpan.onmouseleave = () => shareSpan.style.opacity = "0.75";
|
||||
|
||||
shareSpan.innerHTML = `
|
||||
<svg t="1764059839985" class="icon" viewBox="0 0 1236 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5667" width="20" height="20"><path d="M741.743 1018.343c-28.287 0-50.917-11.315-73.547-28.288-22.63-22.63-39.602-50.917-39.602-84.862V792.044c-124.464 0-328.133 33.945-435.624 181.039-16.973 28.287-56.575 45.26-90.52 50.917H85.478C28.903 1012.685-5.042 961.768 0.616 905.193c28.287-243.27 113.15-418.652 260.243-537.458 107.492-84.862 231.956-130.122 367.735-141.437V118.807c0-50.917 22.63-96.177 67.89-113.15C736.086-5.657 781.345 0 815.29 33.945l362.077 367.735c28.288 22.63 45.26 56.574 50.918 96.176 5.657 39.603-5.658 79.205-33.945 107.492-5.658 5.658-11.315 16.972-22.63 22.63l-350.762 356.42c-22.63 22.63-50.918 33.945-79.205 33.945z m-90.52-339.448h90.52v226.298l356.42-367.734 5.658-5.658c5.657-5.657 5.657-16.972 5.657-22.63 0-11.315-5.657-16.972-11.315-22.63l-5.657-5.657-356.42-362.077V333.79l-79.205 5.658c-118.806 0-231.956 39.602-328.132 113.149-113.15 90.519-186.696 237.613-209.326 429.967 141.436-175.382 390.364-203.669 531.8-203.669z" p-id="5668"></path></svg>
|
||||
<svg t="1764059839985" class="icon" viewBox="0 0 1236 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5667" width="20" height="20"><path d="M741.743 1018.343c-28.287 0-50.917-11.315-73.547-28.288-22.63-22.63-39.602-50.917-39.602-84.862V792.044c-124.464 0-328.133 33.945-435.624 181.039-16.973 28.287-56.575 45.26-90.52 50.917H85.478C28.903 1012.685-5.042 961.768 0.616 905.193c28.287-243.27 113.15-418.652 260.243-537.458 107.492-84.862 231.956-130.122 367.735-141.437V118.807c0-50.917 22.63-96.177 67.89-113.15C736.086-5.657 781.345 0 815.29 33.945l362.077 367.735c28.288 22.63 45.26 56.574 50.918 96.176 5.657 39.603-5.658 79.205-33.945 107.492-5.658 5.658-11.315 16.972-22.63 22.63l-350.762 356.42c-22.63 22.63-50.918 33.945-79.205 33.945z m-90.52-339.448h90.52v226.298l356.42-367.734 5.658-5.658c5.657-5.657 5.657-16.972 5.657-22.63 0-11.315-5.657-16.972-11.315-22.63l-5.657-5.657-356.42-362.077V333.79l-79.205 5.658c-118.806 0-231.956 39.602-328.132 113.149-113.15 90.519-186.696 237.613-209.326 429.967 141.436-175.382 390.364-203.669 531.8-203.669z" p-id="5668" fill="#878895"></path></svg>
|
||||
`;
|
||||
|
||||
|
||||
shareSpan.onclick = () => {
|
||||
generatePoster(aiMsg.content);
|
||||
generatePoster(content, imgUrl);
|
||||
};
|
||||
|
||||
if (role === "assistant") {
|
||||
// 分享按钮
|
||||
const shareSpan = document.createElement("span");
|
||||
shareSpan.style.display = "inline-flex";
|
||||
shareSpan.style.alignItems = "center";
|
||||
shareSpan.style.cursor = "pointer";
|
||||
shareSpan.style.marginTop = "8px";
|
||||
shareSpan.style.opacity = "0.75";
|
||||
shareSpan.style.transition = "opacity .2s";
|
||||
shareSpan.title = "分享";
|
||||
// msg.appendChild(shareSpan);
|
||||
|
||||
shareSpan.onmouseenter = () => shareSpan.style.opacity = "1";
|
||||
shareSpan.onmouseleave = () => shareSpan.style.opacity = "0.75";
|
||||
// ======================
|
||||
// ✅ 复制按钮(新增)
|
||||
// ======================
|
||||
const copySpan = document.createElement("span");
|
||||
copySpan.style.display = "inline-flex";
|
||||
copySpan.style.alignItems = "center";
|
||||
copySpan.style.cursor = "pointer";
|
||||
copySpan.style.marginTop = "8px";
|
||||
copySpan.style.marginLeft = "10px";
|
||||
copySpan.style.opacity = "0.75";
|
||||
copySpan.style.transition = "opacity .2s";
|
||||
copySpan.title = "复制内容";
|
||||
|
||||
shareSpan.innerHTML = `
|
||||
<svg viewBox="0 0 1236 1024" width="20" height="20">
|
||||
<path d="M741.743 1018.343c-28.287 0-50.917-11.315-73.547-28.288-22.63-22.63-39.602-50.917-39.602-84.862V792.044c-124.464 0-328.133 33.945-435.624 181.039-16.973 28.287-56.575 45.26-90.52 50.917H85.478C28.903 1012.685-5.042 961.768 0.616 905.193c28.287-243.27 113.15-418.652 260.243-537.458 107.492-84.862 231.956-130.122 367.735-141.437V118.807c0-50.917 22.63-96.177 67.89-113.15C736.086-5.657 781.345 0 815.29 33.945l362.077 367.735c28.288 22.63 45.26 56.574 50.918 96.176 5.657 39.603-5.658 79.205-33.945 107.492-5.658 5.658-11.315 16.972-22.63 22.63l-350.762 356.42c-22.63 22.63-50.918 33.945-79.205 33.945z" />
|
||||
</svg>
|
||||
copySpan.onmouseenter = () => copySpan.style.opacity = "1";
|
||||
copySpan.onmouseleave = () => copySpan.style.opacity = "0.75";
|
||||
|
||||
copySpan.innerHTML = `
|
||||
<svg t="1764549398754" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5335" width="20" height="20"><path d="M639.9 256.3H192.4c-35.2 0-63.9 28.8-63.9 63.9v575.4c0 35.2 28.8 63.9 63.9 63.9h447.5c35.2 0 63.9-28.8 63.9-63.9V320.2c0-35.1-28.8-63.9-63.9-63.9z m0 639.3H192.4V320.2h447.5v575.4z" fill="#878895" p-id="5336"></path><path d="M831.6 64.5H384.1c-35.2 0-63.9 28.8-63.9 63.9v63.9h63.9v-63.9h447.5v575.4h-63.9v63.9h63.9c35.2 0 63.9-28.8 63.9-63.9V128.4c0.1-35.1-28.7-63.9-63.9-63.9z" fill="#878895" p-id="5337"></path></svg>
|
||||
`;
|
||||
|
||||
shareSpan.onclick = () => {
|
||||
generatePoster(content, imgUrl);
|
||||
};
|
||||
copySpan.onclick = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(content);
|
||||
copySpan.style.opacity = "1";
|
||||
showToast("复制成功")
|
||||
copySpan.title = "复制成功";
|
||||
setTimeout(() => { copySpan.title = "复制内容"; }, 1200);
|
||||
} catch (err) {
|
||||
alert("复制失败,可能不支持 HTTPS 环境以外复制。");
|
||||
}
|
||||
};
|
||||
|
||||
msg.appendChild(shareSpan);
|
||||
|
||||
// ======================
|
||||
// ✅ 复制按钮(新增)
|
||||
// ======================
|
||||
const copySpan = document.createElement("span");
|
||||
copySpan.style.display = "inline-flex";
|
||||
copySpan.style.alignItems = "center";
|
||||
copySpan.style.cursor = "pointer";
|
||||
copySpan.style.marginTop = "8px";
|
||||
copySpan.style.marginLeft = "10px";
|
||||
copySpan.style.opacity = "0.75";
|
||||
copySpan.style.transition = "opacity .2s";
|
||||
copySpan.title = "复制内容";
|
||||
|
||||
copySpan.onmouseenter = () => copySpan.style.opacity = "1";
|
||||
copySpan.onmouseleave = () => copySpan.style.opacity = "0.75";
|
||||
|
||||
copySpan.innerHTML = `
|
||||
<svg viewBox="0 0 1024 1024" width="20" height="20">
|
||||
<path d="M320 128h448v64H320zM256 256h512v64H256zM192 384h640v64H192zM256 512h512v64H256zM320 640h448v64H320z"/>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
copySpan.onclick = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(content);
|
||||
copySpan.style.opacity = "1";
|
||||
showToast("复制成功")
|
||||
copySpan.title = "复制成功";
|
||||
setTimeout(() => { copySpan.title = "复制内容"; }, 1200);
|
||||
} catch (err) {
|
||||
alert("复制失败,可能不支持 HTTPS 环境以外复制。");
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
setTimeout(() => {
|
||||
msgDiv.appendChild(shareSpan);
|
||||
@@ -3202,6 +3218,20 @@
|
||||
showToast("提交成功", 'success')
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('beforeunload', function (event) {
|
||||
const data = {
|
||||
userId: userId
|
||||
}
|
||||
const res = fetch('https://serviceai.satabot.com/updateAiChatNum', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
||||
console.log(res, 98888);
|
||||
debugger;
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user