diff --git a/business/api/auth.go b/business/api/auth.go index 0db60b4..11ec98b 100644 --- a/business/api/auth.go +++ b/business/api/auth.go @@ -143,6 +143,7 @@ func (p DefParty) userUploadFile() web_iris.Party { index.Post(AuthBase+"/userUploadFile", func(ctx *context.Context) { headerInfo := GetHeaderBaseInfo(ctx) fileName := CtxFileUpload(ctx) + fileName = web.CONFIG.System.Domain + "/static/uploads/" + fileName Success(ctx, headerInfo, UserUploadFileResponse{fileName}) }) }} diff --git a/business/api/init.go b/business/api/init.go index ab0bcd4..9b2f125 100644 --- a/business/api/init.go +++ b/business/api/init.go @@ -17,6 +17,7 @@ var Root = "/pet-house" var ExcludeBase = "/static" var ExcludeBase1 = "/debug" var ExcludeBase2 = "/admin" +var ExcludeBase3 = "/system" var frontExcludes = [...]string{ Root + AuthBase + "/login", @@ -61,6 +62,10 @@ func FrontAuth(ctx *context.Context) { ctx.Next() return } + if strings.Contains(ctx.Path(), ExcludeBase3) { + ctx.Next() + return + } frontExcludesStr := strings.Join(frontExcludes[:], ",") if strings.Contains(frontExcludesStr, ctx.Path()) { ctx.Next() diff --git a/business/api/order.go b/business/api/order.go index cc4a3f8..f7e319b 100644 --- a/business/api/order.go +++ b/business/api/order.go @@ -62,7 +62,7 @@ func (p DefParty) orderCreate() web_iris.Party { orderMain := models.OrderMain{ OrderId: orderId, Uid: headerBaseInfo.Uid, - Status: 0, + Status: 1, ServiceTime: orderCreateRequest.ServiceTime, ServiceAddrId: orderCreateRequest.ServiceAddrId, ServiceRemark: "", diff --git a/business/api/pet.go b/business/api/pet.go index 153d84a..006b995 100644 --- a/business/api/pet.go +++ b/business/api/pet.go @@ -51,7 +51,7 @@ func (p DefParty) petList() web_iris.Party { } type PetInfoRequest struct { - Id int64 + Id int64 `json:"id"` } type PetInfoResponse struct { diff --git a/business/config/web.json b/business/config/web.json index 6c107aa..1935175 100644 --- a/business/config/web.json +++ b/business/config/web.json @@ -24,6 +24,7 @@ "session-timeout": 60, "system": { "addr": "127.0.0.1:18005", + "domain": "http://49.232.45.133:18005", "db-type": "mysql", "level": "debug", "time-format": "2006-01-02 15:04:05", diff --git a/core/server/web/config.go b/core/server/web/config.go index e156082..4e99d44 100644 --- a/core/server/web/config.go +++ b/core/server/web/config.go @@ -34,6 +34,7 @@ var CONFIG = Web{ Tls: false, Level: "debug", Addr: "127.0.0.1:8085", + Domain: "http://127.0.0.1:8085", DbType: "mysql", TimeFormat: "2006-01-02 15:04:05", }, @@ -88,6 +89,7 @@ type System struct { Tls bool `mapstructure:"tls" json:"tls" yaml:"tls"` // debug,release,test Level string `mapstructure:"level" json:"level" yaml:"level"` // debug,release,test Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` + Domain string `mapstructure:"domain" json:"domain" yaml:"domain"` StaticPrefix string `mapstructure:"static-prefix" json:"static-prefix" yaml:"static-prefix"` WebPrefix string `mapstructure:"web-prefix" json:"web-prefix" yaml:"web-prefix"` DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"` @@ -198,6 +200,7 @@ func getViperConfig() viper_server.ViperConfig { "tls": ` + tls + `, "level": "` + CONFIG.System.Level + `", "addr": "` + CONFIG.System.Addr + `", + "domain": "` + CONFIG.System.Domain + `", "db-type": "` + CONFIG.System.DbType + `", "time-format": "` + CONFIG.System.TimeFormat + `" } diff --git a/core/server/web/config/web.json b/core/server/web/config/web.json index 7803abb..fd5dd74 100644 --- a/core/server/web/config/web.json +++ b/core/server/web/config/web.json @@ -28,6 +28,7 @@ "session-timeout": 60, "system": { "addr": "127.0.0.1:8085", + "domain": "http://127.0.0.1:8085", "db-type": "mysql", "level": "debug", "time-format": "2006-01-02 15:04:05", diff --git a/core/server/web/web_iris/config/web.json b/core/server/web/web_iris/config/web.json index 7803abb..fd5dd74 100644 --- a/core/server/web/web_iris/config/web.json +++ b/core/server/web/web_iris/config/web.json @@ -28,6 +28,7 @@ "session-timeout": 60, "system": { "addr": "127.0.0.1:8085", + "domain": "http://127.0.0.1:8085", "db-type": "mysql", "level": "debug", "time-format": "2006-01-02 15:04:05",