Example #1
0
func getQiniuTokenHandler(r *http.Request, w http.ResponseWriter,
	redis *models.RedisLogger) {
	token := redis.GetQiniuUpToken()
	//log.Println(token)
	if len(token) == 0 {
		token = uptoken("test")
		redis.SetQiniuUpToken(token)
	}

	writeResponse(r.RequestURI, w, map[string]string{"token": token}, nil)
}