设置本地时区
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
|||||||
"github.com/gogf/gf/v2/net/ghttp"
|
"github.com/gogf/gf/v2/net/ghttp"
|
||||||
"github.com/gogf/gf/v2/net/gsvc"
|
"github.com/gogf/gf/v2/net/gsvc"
|
||||||
"github.com/gogf/gf/v2/os/glog"
|
"github.com/gogf/gf/v2/os/glog"
|
||||||
|
"github.com/gogf/gf/v2/os/gtime"
|
||||||
"github.com/gogf/gf/v2/util/gconv"
|
"github.com/gogf/gf/v2/util/gconv"
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
@@ -33,6 +34,10 @@ var Httpserver = g.Server()
|
|||||||
var Httpclient = g.Client()
|
var Httpclient = g.Client()
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
err := gtime.SetTimeZone("Asia/Shanghai")
|
||||||
|
if err != nil {
|
||||||
|
panic("设置时区失败")
|
||||||
|
}
|
||||||
//s.Use(common.Cors) //中间件验证
|
//s.Use(common.Cors) //中间件验证
|
||||||
//s.EnablePProf() //启用性能分析
|
//s.EnablePProf() //启用性能分析
|
||||||
Httpserver.SetOpenApiPath("/api.json")
|
Httpserver.SetOpenApiPath("/api.json")
|
||||||
|
|||||||
Reference in New Issue
Block a user