Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
6521fc27
提交
6521fc27
authored
7月 02, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 支持本地AI调用
上级
8354c27b
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
19 行增加
和
6 行删除
+19
-6
useChat.js
src/composables/useChat.js
+8
-2
AISummaryDialog.vue
src/modules/analyze/user/components/AISummaryDialog.vue
+1
-0
AISummaryDialog.vue
src/modules/label/components/AISummaryDialog.vue
+1
-0
AISummaryDialog.vue
src/modules/user/components/AISummaryDialog.vue
+1
-0
axios.ts
src/utils/axios.ts
+8
-4
没有找到文件。
src/composables/useChat.js
浏览文件 @
6521fc27
...
@@ -40,9 +40,15 @@ export function useChat() {
...
@@ -40,9 +40,15 @@ export function useChat() {
content
=
content
.
replaceAll
(
'
\
n'
,
'<br/>'
)
content
=
content
.
replaceAll
(
'
\
n'
,
'<br/>'
)
}
}
if
(
messageIndex
===
-
1
)
{
if
(
messageIndex
===
-
1
)
{
messages
.
value
.
push
({
id
,
role
:
'assistant'
,
content
})
messages
.
value
.
push
({
id
,
role
:
'assistant'
,
content
:
content
.
replace
(
/<think>
[\s\S]
*
?
<
\/
think>/g
,
''
).
replace
(
/^
((
<br
\s
*
\/?
>
)
|
\s
|
\\
n|
\\
r
)
+/g
,
''
),
})
}
else
{
}
else
{
messages
.
value
[
messageIndex
].
content
=
messages
.
value
[
messageIndex
].
content
+
content
messages
.
value
[
messageIndex
].
content
=
(
messages
.
value
[
messageIndex
].
content
+
content
)
.
replace
(
/<think>
[\s\S]
*
?
<
\/
think>/g
,
''
)
.
replace
(
/^
((
<br
\s
*
\/?
>
)
|
\s
|
\\
n|
\\
r
)
+/g
,
''
)
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
...
...
src/modules/analyze/user/components/AISummaryDialog.vue
浏览文件 @
6521fc27
...
@@ -10,6 +10,7 @@ async function fetchAI() {
...
@@ -10,6 +10,7 @@ async function fetchAI() {
const
stream
=
await
getAISummary
()
const
stream
=
await
getAISummary
()
aiStreamParse
(
stream
,
(
json
,
messageContent
)
=>
{
aiStreamParse
(
stream
,
(
json
,
messageContent
)
=>
{
content
.
value
+=
messageContent
content
.
value
+=
messageContent
content
.
value
=
content
.
value
.
replace
(
/<think>
[\s\S]
*
?
<
\/
think>/g
,
''
).
replace
(
/^
((
<br
\s
*
\/?
>
)
|
\s
|
\\
n|
\\
r
)
+/g
,
''
)
})
})
isLoading
.
value
=
false
isLoading
.
value
=
false
}
}
...
...
src/modules/label/components/AISummaryDialog.vue
浏览文件 @
6521fc27
...
@@ -10,6 +10,7 @@ async function fetchAI() {
...
@@ -10,6 +10,7 @@ async function fetchAI() {
const
stream
=
await
getAISummary
()
const
stream
=
await
getAISummary
()
aiStreamParse
(
stream
,
(
json
,
messageContent
)
=>
{
aiStreamParse
(
stream
,
(
json
,
messageContent
)
=>
{
content
.
value
+=
messageContent
content
.
value
+=
messageContent
content
.
value
=
content
.
value
.
replace
(
/<think>
[\s\S]
*
?
<
\/
think>/g
,
''
).
replace
(
/^
((
<br
\s
*
\/?
>
)
|
\s
|
\\
n|
\\
r
)
+/g
,
''
)
})
})
isLoading
.
value
=
false
isLoading
.
value
=
false
}
}
...
...
src/modules/user/components/AISummaryDialog.vue
浏览文件 @
6521fc27
...
@@ -12,6 +12,7 @@ async function fetchAI() {
...
@@ -12,6 +12,7 @@ async function fetchAI() {
const
stream
=
await
getAISummary
({
member_id
:
props
.
id
})
const
stream
=
await
getAISummary
({
member_id
:
props
.
id
})
aiStreamParse
(
stream
,
(
json
,
messageContent
)
=>
{
aiStreamParse
(
stream
,
(
json
,
messageContent
)
=>
{
content
.
value
+=
messageContent
content
.
value
+=
messageContent
content
.
value
=
content
.
value
.
replace
(
/<think>
[\s\S]
*
?
<
\/
think>/g
,
''
).
replace
(
/^
((
<br
\s
*
\/?
>
)
|
\s
|
\\
n|
\\
r
)
+/g
,
''
)
})
})
isLoading
.
value
=
false
isLoading
.
value
=
false
}
}
...
...
src/utils/axios.ts
浏览文件 @
6521fc27
...
@@ -7,7 +7,7 @@ const httpRequest = axios.create({
...
@@ -7,7 +7,7 @@ const httpRequest = axios.create({
withCredentials
:
true
,
withCredentials
:
true
,
headers
:
{
headers
:
{
// 'Content-Type': 'application/x-www-form-urlencoded'
// 'Content-Type': 'application/x-www-form-urlencoded'
}
}
,
})
})
// 请求拦截
// 请求拦截
...
@@ -19,14 +19,14 @@ httpRequest.interceptors.request.use(
...
@@ -19,14 +19,14 @@ httpRequest.interceptors.request.use(
config
.
params
=
Object
.
assign
({},
config
.
params
,
{
config
.
params
=
Object
.
assign
({},
config
.
params
,
{
experiment_id
:
params
.
get
(
'experiment_id'
),
experiment_id
:
params
.
get
(
'experiment_id'
),
student_id
:
params
.
get
(
'student_id'
)
||
undefined
,
student_id
:
params
.
get
(
'student_id'
)
||
undefined
,
force_tgc
:
params
.
get
(
'force_tgc'
)
||
undefined
force_tgc
:
params
.
get
(
'force_tgc'
)
||
undefined
,
})
})
if
(
config
.
method
===
'post'
)
if
(
config
.
method
===
'post'
)
config
.
data
=
Object
.
assign
({},
config
.
data
,
{
config
.
data
=
Object
.
assign
({},
config
.
data
,
{
experiment_id
:
params
.
get
(
'experiment_id'
),
experiment_id
:
params
.
get
(
'experiment_id'
),
student_id
:
params
.
get
(
'student_id'
)
||
undefined
,
student_id
:
params
.
get
(
'student_id'
)
||
undefined
,
force_tgc
:
params
.
get
(
'force_tgc'
)
||
undefined
force_tgc
:
params
.
get
(
'force_tgc'
)
||
undefined
,
})
})
return
config
return
config
...
@@ -52,7 +52,11 @@ httpRequest.interceptors.response.use(
...
@@ -52,7 +52,11 @@ httpRequest.interceptors.response.use(
if
(
import
.
meta
.
env
.
VITE_STATIC_URL
)
{
if
(
import
.
meta
.
env
.
VITE_STATIC_URL
)
{
try
{
try
{
const
regex
=
/
(
http|https
)
:
\/\/(
.*
?)
saas-lab-api/gi
const
regex
=
/
(
http|https
)
:
\/\/(
.*
?)
saas-lab-api/gi
return
JSON
.
parse
(
JSON
.
stringify
(
data
).
replaceAll
(
regex
,
import
.
meta
.
env
.
VITE_STATIC_URL
))
const
dataStr
=
JSON
.
stringify
(
data
)
if
(
regex
.
test
(
dataStr
))
{
return
JSON
.
parse
(
dataStr
.
replaceAll
(
regex
,
import
.
meta
.
env
.
VITE_STATIC_URL
))
}
return
data
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论