mirror of https://github.com/certd/certd
				
				
				
			perf: 验证码可重试次数设置为3次
							parent
							
								
									a6824d9cd0
								
							
						
					
					
						commit
						1bdceeecf4
					
				| 
						 | 
				
			
			@ -11,6 +11,9 @@ services:
 | 
			
		|||
      #   ↓↓↓↓↓ -------------------------------------------------------- 数据库以及证书存储路径,默认存在宿主机的/data/certd/目录下,【您需要定时备份此目录,以保障数据容灾】
 | 
			
		||||
      #                                                                  只要修改冒号前面的,冒号后面的/app/data不要动
 | 
			
		||||
      - /data/certd:/app/data
 | 
			
		||||
      #   ↓↓↓↓↓ -------------------------------------------------------- 如果走时不准,考虑挂载localtime文件
 | 
			
		||||
      #- /etc/localtime:/etc/localtime
 | 
			
		||||
      #- /etc/timezone:/etc/timezone
 | 
			
		||||
    ports: # 端口映射
 | 
			
		||||
      #  ↓↓↓↓ ---------------------------------------------------------- 如果端口有冲突,可以修改第一个7001为其他不冲突的端口号,第二个7001不要动
 | 
			
		||||
      - "7001:7001"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,8 +65,16 @@ networks:
 | 
			
		|||
docker logs -f --tail 200 certd
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 6. 容器内走时不准,或者时区不对
 | 
			
		||||
走时不准确,慢慢偏差越来越大    
 | 
			
		||||
或者整个时区都不对    
 | 
			
		||||
可以尝试挂载localtime文件
 | 
			
		||||
```yaml
 | 
			
		||||
    volumes:
 | 
			
		||||
      #   ↓↓↓↓↓ -------------------- 如果走时不准,请尝试挂载localtime文件
 | 
			
		||||
      - /etc/localtime:/etc/localtime
 | 
			
		||||
      - /etc/timezone:/etc/timezone
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -174,7 +174,7 @@ export class CodeService {
 | 
			
		|||
  buildEmailCodeKey(email: string, randomStr: string, verificationType?: string) {
 | 
			
		||||
    return ['email', verificationType, email, randomStr].filter(item => !!item).join(':');
 | 
			
		||||
  }
 | 
			
		||||
  checkValidateCode(key: string, userCode: string, throwError = true, errorNum = 0) {
 | 
			
		||||
  checkValidateCode(key: string, userCode: string, throwError = true, errorNum = 3) {
 | 
			
		||||
    // 记录异常次数key
 | 
			
		||||
    const err_num_key = key + ':err_num';
 | 
			
		||||
    //验证图片验证码
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue