diff --git a/controller/user.go b/controller/user.go index 631f92a6..174300ed 100644 --- a/controller/user.go +++ b/controller/user.go @@ -259,17 +259,17 @@ func GetUserDashboard(c *gin.Context) { if err != nil { c.JSON(http.StatusOK, gin.H{ "success": false, - "message": "无法获取统计信息.", + "message": "无法获取统计信息", "data": nil, }) return } - c.JSON(http.StatusOK, gin.H{ "success": true, "message": "", "data": dashboards, }) + return } func GenerateAccessToken(c *gin.Context) { diff --git a/model/log.go b/model/log.go index a33ac8a2..aa4be60d 100644 --- a/model/log.go +++ b/model/log.go @@ -193,7 +193,7 @@ type LogStatistic struct { CompletionTokens int `gorm:"column:completion_tokens"` } -func SearchLogsByDayAndModel(user_id, start, end int) (LogStatistics []*LogStatistic, err error) { +func SearchLogsByDayAndModel(userId, start, end int) (LogStatistics []*LogStatistic, err error) { groupSelect := "DATE_FORMAT(FROM_UNIXTIME(created_at), '%Y-%m-%d') as day" if common.UsingPostgreSQL { @@ -212,13 +212,13 @@ func SearchLogsByDayAndModel(user_id, start, end int) (LogStatistics []*LogStati sum(completion_tokens) as completion_tokens FROM logs WHERE type=2 - AND user_id= ? + AND userId= ? AND created_at BETWEEN ? AND ? GROUP BY day, model_name ORDER BY day, model_name - `, user_id, start, end).Scan(&LogStatistics).Error + `, userId, start, end).Scan(&LogStatistics).Error - fmt.Println(user_id, start, end) + fmt.Println(userId, start, end) return LogStatistics, err } diff --git a/web/berry/package.json b/web/berry/package.json index f428fd9c..dc0fd4f7 100644 --- a/web/berry/package.json +++ b/web/berry/package.json @@ -40,7 +40,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "react-scripts build && mv -f build ../build/berry", + "build": "GENERATE_SOURCEMAP=false react-scripts build && mv -f build ../build/berry", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/web/berry/src/ui-component/Footer.js b/web/berry/src/ui-component/Footer.js index 7d240495..38f61993 100644 --- a/web/berry/src/ui-component/Footer.js +++ b/web/berry/src/ui-component/Footer.js @@ -22,7 +22,10 @@ const Footer = () => { JustSong {' '} - 构建,,源代码遵循 + 构建,主题 berry 来自{' '} + + MartialBE + {' '},源代码遵循 MIT 协议 )}