ai状态修改
This commit is contained in:
parent
2e30be6830
commit
4fe4aa1e6b
@ -188,13 +188,15 @@ export default function AiHelper(props: PropsType) {
|
||||
ping();
|
||||
}
|
||||
ws.current.onmessage = (event) => {
|
||||
// console.log('message', event);
|
||||
// console.log(event.data);
|
||||
console.log('message', event.data);
|
||||
|
||||
|
||||
if (event.data == 'PONE') {
|
||||
return;
|
||||
}
|
||||
const data = JSON.parse(event.data);
|
||||
// console.log('data',data.type);
|
||||
|
||||
if (data.projId != props.projId) {
|
||||
return;
|
||||
}
|
||||
@ -249,9 +251,50 @@ export default function AiHelper(props: PropsType) {
|
||||
// setIsProjModArrayLoading(true);
|
||||
listMods();
|
||||
}
|
||||
// else if (data.type == 'SYSTEM_ERROR') {
|
||||
// console.log(data.content);
|
||||
// // console.log(JSON.parse());
|
||||
// // messageApi.error(data.content)
|
||||
// // const con = JSON.parse(data.content)
|
||||
// const parts = data.content.split(':');
|
||||
// const errorType = parts[1].trim();
|
||||
// if (errorType == 'introduction') {
|
||||
// messageApi.error('请重试')
|
||||
// setIsProjIntroductionLoading(false);
|
||||
// setIsProjDescLoading(false);
|
||||
// setIsProjModArrayLoading(false);
|
||||
// }else if(errorType == 'desc'){
|
||||
// messageApi.error('请重试')
|
||||
// setIsProjDescLoading(false);
|
||||
// }else if(errorType == 'mods'){
|
||||
// messageApi.error('请重试')
|
||||
// setIsProjModArrayLoading(false);
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
else if (data.type == 'PROJ_INTRODUCTION_ERROR') {
|
||||
messageApi.error('请重试')
|
||||
setIsProjIntroductionLoading(false);
|
||||
setIsProjDescLoading(false);
|
||||
setIsProjModArrayLoading(false);
|
||||
// return;
|
||||
}
|
||||
else if (data.type == 'PROJ_DESC_ERROR') {
|
||||
messageApi.error('系统详情生成失败 , 请重试')
|
||||
setIsProjDescLoading(false);
|
||||
}
|
||||
else if (data.type == 'PROJ_MODS_ERROR') {
|
||||
messageApi.error('功能列表生成失败 , 请重试')
|
||||
setIsProjModArrayLoading(false);
|
||||
}
|
||||
}
|
||||
ws.current.onerror = (event) => {
|
||||
console.log('error', event);
|
||||
// setIsProjModArrayLoading(false);
|
||||
// setIsProjDescLoading(false);
|
||||
// setIsProjIntroductionLoading(false);
|
||||
// messageApi.error('请重试')
|
||||
}
|
||||
ws.current.onclose = (event) => {
|
||||
console.log('close', event);
|
||||
|
Loading…
Reference in New Issue
Block a user