From cf627762cbc2db58943fa81609cfe22e6b0f1172 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Sun, 27 Dec 2015 18:53:43 +0800 Subject: [PATCH] (*)no website switch in env variable --- controllers/default.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/default.go b/controllers/default.go index 0a95c40..deefa03 100644 --- a/controllers/default.go +++ b/controllers/default.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/astaxie/beego" "net" + "os" "strings" ) @@ -270,6 +271,10 @@ func (this *MainController) GetAllJSON() { } func (this *MainController) Get() { + if noweb := os.Getenv("NOWEB"); noweb == "1" { + this.Abort(404) + return + } this.Data["Email"] = "missdeer@dfordsoft.com" this.Data["UserAgent"] = this.Ctx.Request.UserAgent() ip := this.Ctx.Input.IP()