mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
fix: fixed conflicts
This commit is contained in:
commit
00c520d066
@ -184,7 +184,7 @@ docker-compose up -d
|
|||||||
|
|
||||||
### 2. 修改配置文档
|
### 2. 修改配置文档
|
||||||
|
|
||||||
先拷贝项目中的 `api/go/config.sample.toml` 配置文档,修改代理地址和管理员密码:
|
先拷贝项目中的 `api/config.sample.toml` 配置文档,修改代理地址和管理员密码:
|
||||||
|
|
||||||
如何修改请参考[修改配置文档](#2-修改配置文档)
|
如何修改请参考[修改配置文档](#2-修改配置文档)
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ server {
|
|||||||
3. 运行后端程序:
|
3. 运行后端程序:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd api/go
|
cd api
|
||||||
# 1. 先下载依赖
|
# 1. 先下载依赖
|
||||||
go mod tidy
|
go mod tidy
|
||||||
# 2. 运行程序
|
# 2. 运行程序
|
||||||
@ -340,7 +340,7 @@ npm run build
|
|||||||
你可以根据个人需求将项目打包成 windows/linux/darwin 平台项目。
|
你可以根据个人需求将项目打包成 windows/linux/darwin 平台项目。
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd api/go
|
cd api
|
||||||
# for all platforms
|
# for all platforms
|
||||||
make all
|
make all
|
||||||
# for linux only
|
# for linux only
|
||||||
|
0
api/go/.gitignore → api/.gitignore
vendored
0
api/go/.gitignore → api/.gitignore
vendored
@ -68,11 +68,18 @@ func (h *UserHandler) Register(c *gin.Context) {
|
|||||||
|
|
||||||
// check if the username is exists
|
// check if the username is exists
|
||||||
var item model.User
|
var item model.User
|
||||||
tx := h.db.Where("username = ?", data.Username).First(&item)
|
res := h.db.Where("username = ?", data.Username).First(&item)
|
||||||
if tx.RowsAffected > 0 {
|
if res.RowsAffected > 0 {
|
||||||
resp.ERROR(c, "用户名已存在")
|
resp.ERROR(c, "用户名已存在")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res = h.db.Where("mobile = ?", data.Mobile).First(&item)
|
||||||
|
if res.RowsAffected > 0 {
|
||||||
|
resp.ERROR(c, "该手机号码以及被注册,请更换其他手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 默认订阅所有角色
|
// 默认订阅所有角色
|
||||||
var chatRoles []model.ChatRole
|
var chatRoles []model.ChatRole
|
||||||
h.db.Find(&chatRoles)
|
h.db.Find(&chatRoles)
|
||||||
@ -110,7 +117,7 @@ func (h *UserHandler) Register(c *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
user.Calls = config.UserInitCalls
|
user.Calls = config.UserInitCalls
|
||||||
}
|
}
|
||||||
res := h.db.Create(&user)
|
res = h.db.Create(&user)
|
||||||
if res.Error != nil {
|
if res.Error != nil {
|
||||||
resp.ERROR(c, "保存数据失败")
|
resp.ERROR(c, "保存数据失败")
|
||||||
logger.Error(res.Error)
|
logger.Error(res.Error)
|
@ -1,5 +0,0 @@
|
|||||||
# chatgpt-plus-java
|
|
||||||
|
|
||||||
chatgpt-plus 后端 API Java 语言实现,待开发。
|
|
||||||
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
# chatgpt-plus-php
|
|
||||||
|
|
||||||
chatgpt-plus 后端 API PHP 语言实现,待开发。
|
|
||||||
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
# chatgpt-plus-python
|
|
||||||
|
|
||||||
chatgpt-plus 后端 API Python 语言实现,待开发。
|
|
||||||
|
|
||||||
|
|
@ -25,6 +25,7 @@ func RandomNumber(bit int) int {
|
|||||||
min := intPow(10, bit-1)
|
min := intPow(10, bit-1)
|
||||||
max := intPow(10, bit) - 1
|
max := intPow(10, bit) - 1
|
||||||
|
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
return rand.Intn(max-min+1) + min
|
return rand.Intn(max-min+1) + min
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user