Add the frame for installation.

This commit is contained in:
zicla
2018-12-03 21:21:37 +08:00
parent 821c625fb9
commit 5611c5acb6
24 changed files with 593 additions and 452 deletions

View File

@ -82,14 +82,14 @@ func (this *BaseController) Wrap(f func(writer http.ResponseWriter, request *htt
writer.Header().Set("Content-Type", "application/json;charset=UTF-8")
//用json的方式输出返回值。
var json = jsoniter.ConfigCompatibleWithStandardLibrary
b, err := json.Marshal(webResult)
b, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(webResult)
this.PanicError(err)
writer.WriteHeader(FetchHttpStatus(webResult.Code))
fmt.Fprintf(writer, string(b))
_, err = fmt.Fprintf(writer, string(b))
this.PanicError(err)
} else {
//输出的内容是二进制的。
@ -117,7 +117,6 @@ func (this *BaseController) Success(data interface{}) *WebResult {
return webResult
}
//允许跨域请求
func (this *BaseController) allowCORS(writer http.ResponseWriter) {
writer.Header().Add("Access-Control-Allow-Origin", "*")