[feature] Format the code and improve Mini Program authorization to o… (#473)

* [feature] Format the code and improve Mini Program authorization to obtain openid(miniprogram/auth/auth.go Code2Session)

* [feature] CheckEncryptedData (https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html)

* upgrade json error

* upgrade json error

Co-authored-by: houseme <houseme@outlook.com>
This commit is contained in:
housemeandhouseme authored and GitHub committed 2021-09-08 11:03:23 +08:00
1 parent 47adf42208
commit 96c1f98944
90 files changed
+787 -760

No files matched your search

+5 -5
View File
@@ -15,10 +15,10 @@ func writeContextType(w http.ResponseWriter, value []string) {
}
}
//Render render from bytes
// Render render from bytes
func (srv *Server) Render(bytes []byte) {
//debug
//fmt.Println("response msg = ", string(bytes))
// debug
// fmt.Println("response msg = ", string(bytes))
srv.Writer.WriteHeader(200)
_, err := srv.Writer.Write(bytes)
if err != nil {
@@ -26,13 +26,13 @@ func (srv *Server) Render(bytes []byte) {
}
}
//String render from string
// String render from string
func (srv *Server) String(str string) {
writeContextType(srv.Writer, plainContentType)
srv.Render([]byte(str))
}
//XML render to xml
// XML render to xml
func (srv *Server) XML(obj interface{}) {
writeContextType(srv.Writer, xmlContentType)
bytes, err := xml.Marshal(obj)