From 68bb5d24b621d08c50f44e740e2f98d2ec933eb5 Mon Sep 17 00:00:00 2001 From: wsczx Date: Sun, 25 Sep 2022 04:16:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/dbdata/db.go | 1 + server/dbdata/setting.go | 1 + server/handler/link_home.go | 6 ++++-- web/src/pages/set/Other.vue | 9 +++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/dbdata/db.go b/server/dbdata/db.go index 00c992c..c52d209 100644 --- a/server/dbdata/db.go +++ b/server/dbdata/db.go @@ -88,6 +88,7 @@ func addInitData() error { other := &SettingOther{ LinkAddr: "vpn.xx.com", Banner: "您已接入公司网络,请按照公司规定使用。\n请勿进行非工作下载及视频行为!", + Homeindex: "AnyLink 是一个企业级远程办公 sslvpn 的软件,可以支持多人同时在线使用。", AccountMail: accountMail, } err = SettingSessAdd(sess, other) diff --git a/server/dbdata/setting.go b/server/dbdata/setting.go index a9ab9e6..4770401 100644 --- a/server/dbdata/setting.go +++ b/server/dbdata/setting.go @@ -22,6 +22,7 @@ type SettingSmtp struct { type SettingOther struct { LinkAddr string `json:"link_addr"` Banner string `json:"banner"` + Homeindex string `json:"homeindex"` AccountMail string `json:"account_mail"` } diff --git a/server/handler/link_home.go b/server/handler/link_home.go index 7be4f64..035a924 100644 --- a/server/handler/link_home.go +++ b/server/handler/link_home.go @@ -6,13 +6,14 @@ import ( "strings" "github.com/bjdgyc/anylink/admin" + "github.com/bjdgyc/anylink/dbdata" ) func LinkHome(w http.ResponseWriter, r *http.Request) { // fmt.Println(r.RemoteAddr) // hu, _ := httputil.DumpRequest(r, true) // fmt.Println("DumpHome: ", string(hu)) - + index := &dbdata.SettingOther connection := strings.ToLower(r.Header.Get("Connection")) userAgent := strings.ToLower(r.UserAgent()) if connection == "close" && (strings.Contains(userAgent, "anyconnect") || strings.Contains(userAgent, "openconnect")) { @@ -22,7 +23,8 @@ func LinkHome(w http.ResponseWriter, r *http.Request) { } w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "AnyLink 是一个企业级远程办公 sslvpn 的软件,可以支持多人同时在线使用。") + fmt.Fprintln(w, index.Homeindex) + // fmt.Fprintln(w, "AnyLink 是一个企业级远程办公 sslvpn 的软件,可以支持多人同时在线使用。") } func LinkOtpQr(w http.ResponseWriter, r *http.Request) { diff --git a/web/src/pages/set/Other.vue b/web/src/pages/set/Other.vue index 20fdf02..8c518c7 100644 --- a/web/src/pages/set/Other.vue +++ b/web/src/pages/set/Other.vue @@ -51,6 +51,15 @@ + + + + +