@ -1,6 +1,9 @@
package comms
import "regexp"
import (
"regexp"
"time"
)
const (
TimeZero = -62135596800
@ -12,6 +15,8 @@ const (
var (
TimeZHT = time.FixedZone("CST", 8*3600)
REG_Host = regexp.MustCompile(`((\w+\.)*)((jzdisk\.)\w+)(:\d+)?`)
REG_Hosts = regexp.MustCompile(`https?://((\w+\.)*)((1ydt\.)\w+)(:\d+)?`)
REG_Phone = regexp.MustCompile(`^([0-9]{0,3})[1][3,4,5,7,8,9][0-9]{9}$`)
@ -8,6 +8,10 @@ import (
func ZHTNow() time.Time {
return time.Now().In(comms.TimeZHT)
}
func GenValidateCode(width int) string {
numeric := [10]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
r := len(numeric)