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