diff --git a/README.md b/README.md index 5c70cc3d..f0d0e3a7 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ graph LR 2. `SESSION_SECRET`:设置之后将使用固定的会话密钥,这样系统重新启动后已登录用户的 cookie 将依旧有效。 + 例子:`SESSION_SECRET=random_string` 3. `SQL_DSN`:设置之后将使用指定数据库而非 SQLite,请使用 MySQL 8.0 版本。 - + 例子:`SQL_DSN=root:123456@tcp(localhost:3306)/one-api` + + 例子:`SQL_DSN=root:123456@tcp(localhost:3306)/oneapi` 4. `FRONTEND_BASE_URL`:设置之后将使用指定的前端地址,而非后端地址。 + 例子:`FRONTEND_BASE_URL=https://openai.justsong.cn` 5. `SYNC_FREQUENCY`:设置之后将定期与数据库同步配置,单位为秒,未设置则不进行同步。 diff --git a/controller/user.go b/controller/user.go index 89e32096..c861651a 100644 --- a/controller/user.go +++ b/controller/user.go @@ -259,7 +259,7 @@ func GenerateAccessToken(c *gin.Context) { } user.AccessToken = common.GetUUID() - if model.DB.Where("token = ?", user.AccessToken).First(user).RowsAffected != 0 { + if model.DB.Where("access_token = ?", user.AccessToken).First(user).RowsAffected != 0 { c.JSON(http.StatusOK, gin.H{ "success": false, "message": "请重试,系统生成的 UUID 竟然重复了!",