wangchuanjin 2 vuotta sitten
vanhempi
commit
d9d330b007
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      common/common.go

+ 9 - 0
common/common.go

@@ -781,3 +781,12 @@ func StrFormat(s string) string {
 	}
 	return fmt.Sprintf("\"%s\"", s)
 }
+
+//判断是否是微信访问
+func IsWxBrowser(Request *http.Request) bool {
+	if strings.Index(Request.UserAgent(), "MicroMessenger") > -1 || strings.Index(Request.UserAgent(), "Wechat") > -1 {
+		return true
+	} else {
+		return false
+	}
+}