Esempio n. 1
0
File: login.go Progetto: ruoL/code
//初始化的函数,设置验证码
func init() {
	store := cache.NewMemoryCache()
	capt = captcha.NewWithFilter("/captcha/", store)
	capt.StdWidth = 120
	capt.StdHeight = 40
	capt.ChallengeNums = 4
}
Esempio n. 2
0
func init() {
	// init captcha
	store := cache.NewMemoryCache()
	cpt = captcha.NewWithFilter("/captcha/", store)
	cpt.ChallengeNums = 4
	cpt.StdWidth = 120
	cpt.StdHeight = 60

	// init db
	orm.RegisterDriver("sqlite", orm.DRSqlite)
	orm.RegisterDataBase("default", "sqlite3", "./idoc_data.db")
	orm.RunSyncdb("default", false, true)
}
Esempio n. 3
0
func init() {
	// read config from file
	EmailUser = beego.AppConfig.String("EmailUser")
	EmailPasswd = beego.AppConfig.String("EmailPasswd")
	if pwd, err := utils.AesDecrypt(EmailPasswd); err != nil {
		panic(err)
	} else {
		EmailPasswd = pwd
	}
	EmailHost = beego.AppConfig.String("EmailHost")

	Log = logs.NewLogger(1000)
	Log.Async()
	Log.SetLogger("console", "")

	// 较简单的校验码
	store := cache.NewMemoryCache()
	Cpt = captcha.NewWithFilter("/captcha/", store)

}
func init() {
	store := cache.NewMemoryCache()
	cpt = captcha.NewWithFilter("/captcha/", store)
}
Esempio n. 5
0
func init() {
	// use beego cache system store the captcha data
	store := cache.NewMemoryCache()
	cpt = captcha.NewWithFilter("/captcha/", store)
}