소스 검색

初始化

wangchuanjin 2 년 전
부모
커밋
d9d330b007
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  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
+	}
+}