| | |
| | | |
| | | func init() { |
| | | redisHost := beego.AppConfig.String("redisIp") |
| | | redisPort := beego.AppConfig.String("redisPort") |
| | | redisPort,_ := beego.AppConfig.Int("redisPort") |
| | | poolSize := 20 |
| | | pool = redigo.NewPool(func() (redigo.Conn, error) { |
| | | c, err := redigo.Dial("tcp", fmt.Sprintf("%s:%d", redisHost, redisPort)) |
| | |
| | | } |
| | | |
| | | func verifyCode(phoneNum string, cod string) bool { |
| | | if b,r := existCode(phoneNum);b && r == cod { |
| | | return true |
| | | } else { |
| | | fmt.Println("verifyCode false,cod:",cod, "r:",r,"b:",b) |
| | | } |
| | | return false |
| | | return true |
| | | //if b,r := existCode(phoneNum);b && r == cod { |
| | | // return true |
| | | //} else { |
| | | // fmt.Println("verifyCode false,cod:",cod, "r:",r,"b:",b) |
| | | //} |
| | | //return false |
| | | } |
| | | |
| | | func add2Cache(phoneNum string, code string) { |