예제 #1
0
파일: wetalk.go 프로젝트: yubo/falcon
// We have to call a initialize function manully
// because we use `bee bale` to pack static resources
// and we cannot make sure that which init() execute first.
func initialize() {
	setting.LoadConfig()

	if err := utils.InitSphinxPools(); err != nil {
		beego.Error(fmt.Sprint("sphinx init pool", err))
	}

	setting.SocialAuth = social.NewSocial("/login/", auth.SocialAuther)
	setting.SocialAuth.ConnectSuccessURL = "/settings/profile"
	setting.SocialAuth.ConnectFailedURL = "/settings/profile"
	setting.SocialAuth.ConnectRegisterURL = "/register/connect"
	setting.SocialAuth.LoginURL = "/login"
}
예제 #2
0
파일: wetalk.go 프로젝트: netxfly/wetalk
// We have to call a initialize function manully
// because we use `bee bale` to pack static resources
// and we cannot make sure that which init() execute first.
func initialize() {
	setting.LoadConfig()

	//set logger
	if setting.IsProMode {
		beego.SetLogger("file", `{"filename":"logs/prod.log"}`)
		beego.SetLevel(beego.LevelInformational)
		beego.BeeLogger.DelLogger("console")
	} else {
		beego.SetLogger("file", `{"filename":"logs/dev.log"}`)
		beego.SetLevel(beego.LevelDebug)
		beego.BeeLogger.SetLogger("console", "")
	}
	beego.SetLogFuncCall(true)
	setting.SocialAuth = social.NewSocial("/login/", auth.SocialAuther)
	setting.SocialAuth.ConnectSuccessURL = "/settings/profile"
	setting.SocialAuth.ConnectFailedURL = "/settings/profile"
	setting.SocialAuth.ConnectRegisterURL = "/register/connect"
	setting.SocialAuth.LoginURL = "/login"

	//Qiniu
	ACCESS_KEY = setting.QiniuAccessKey
	SECRET_KEY = setting.QiniuSecurityKey
}