mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-18 01:06:39 +08:00
禁用 gin 打印日志
This commit is contained in:
parent
bd41f742d2
commit
d515e88d97
@ -176,6 +176,8 @@ func (s *Server) sendMessage(session types.ChatSession, role types.ChatRole, pro
|
||||
if err != nil { // 数据解析出错
|
||||
logger.Error(err, line)
|
||||
replyChunkMessage(ws, types.WsMessage{Type: types.WsEnd, IsHelloMsg: false})
|
||||
replyMessage(ws, ErrorMsg, false)
|
||||
replyMessage(ws, "", true)
|
||||
break
|
||||
}
|
||||
// 初始化 role
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-gonic/gin"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
logger2 "openai/logger"
|
||||
@ -71,6 +72,7 @@ func NewServer(configPath string) (*Server, error) {
|
||||
func (s *Server) Run(webRoot embed.FS, path string, debug bool) {
|
||||
s.DebugMode = debug
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
gin.DefaultWriter = io.Discard
|
||||
engine := gin.Default()
|
||||
if debug {
|
||||
engine.Use(corsMiddleware())
|
||||
|
@ -134,7 +134,7 @@ export default defineComponent({
|
||||
toolBoxHeight: 61 + 42, // 工具框的高度
|
||||
inputBoxWidth: window.innerWidth - 20,
|
||||
sending: false,
|
||||
loading: false
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user