正在显示
12 个修改的文件
包含
57 行增加
和
27 行删除
| @@ -8,6 +8,7 @@ import ( | @@ -8,6 +8,7 @@ import ( | ||
| 8 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain" | 8 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain" |
| 9 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/svr" | 9 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/svr" |
| 10 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" | 10 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" |
| 11 | + "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log" | ||
| 11 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol" | 12 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol" |
| 12 | "strings" | 13 | "strings" |
| 13 | "time" | 14 | "time" |
| @@ -46,6 +47,10 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp | @@ -46,6 +47,10 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp | ||
| 46 | return | 47 | return |
| 47 | } | 48 | } |
| 48 | } | 49 | } |
| 50 | + if !partnerInfo.IsEnable() { | ||
| 51 | + err = protocol.NewErrWithMessage(2002) //账号禁用 | ||
| 52 | + return | ||
| 53 | + } | ||
| 49 | switch request.GrantType { | 54 | switch request.GrantType { |
| 50 | case protocol.LoginByPassword: | 55 | case protocol.LoginByPassword: |
| 51 | if len(partnerInfo.Password) == 0 { | 56 | if len(partnerInfo.Password) == 0 { |
| @@ -76,6 +81,7 @@ func SmsCode(request *protocol.SmsCodeRequest) (rsp *protocol.SmsCodeResponse, e | @@ -76,6 +81,7 @@ func SmsCode(request *protocol.SmsCodeRequest) (rsp *protocol.SmsCodeResponse, e | ||
| 76 | if msg, ok := data["msg"]; ok { | 81 | if msg, ok := data["msg"]; ok { |
| 77 | err = protocol.NewCustomMessage(1, msg.(string)) | 82 | err = protocol.NewCustomMessage(1, msg.(string)) |
| 78 | } | 83 | } |
| 84 | + log.Error(err, data) | ||
| 79 | return | 85 | return |
| 80 | } | 86 | } |
| 81 | return | 87 | return |
pkg/domain/buyer.go
已删除
100644 → 0
pkg/domain/company.go
0 → 100644
| @@ -151,3 +151,13 @@ type DividendOrdersQueryOption struct { | @@ -151,3 +151,13 @@ type DividendOrdersQueryOption struct { | ||
| 151 | Offset int `json:"offset,omitempty"` | 151 | Offset int `json:"offset,omitempty"` |
| 152 | Limit int `json:"limit,omitempty"` | 152 | Limit int `json:"limit,omitempty"` |
| 153 | } | 153 | } |
| 154 | + | ||
| 155 | +//买家 | ||
| 156 | +type Buyer struct { | ||
| 157 | + //买家姓名 | ||
| 158 | + BuyerName string `json:"buyerName"` | ||
| 159 | + //联系方式 | ||
| 160 | + ContactInfo string `json:"contactInfo"` | ||
| 161 | + //收获地址 | ||
| 162 | + ShippingAddress string `json:"shippingAddress"` | ||
| 163 | +} |
| @@ -88,7 +88,24 @@ func (m *PartnerInfo) PartnerCategoryInfo() *PartnerCategoryInfo { | @@ -88,7 +88,24 @@ func (m *PartnerInfo) PartnerCategoryInfo() *PartnerCategoryInfo { | ||
| 88 | } | 88 | } |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | +//账号是否有效 | ||
| 92 | +func (m *PartnerInfo) IsEnable() bool { | ||
| 93 | + return m.Status == 1 | ||
| 94 | +} | ||
| 95 | + | ||
| 91 | type PartnerCategoryInfo struct { | 96 | type PartnerCategoryInfo struct { |
| 92 | Id int `json:"id"` | 97 | Id int `json:"id"` |
| 93 | Name string `json:"name"` | 98 | Name string `json:"name"` |
| 94 | } | 99 | } |
| 100 | + | ||
| 101 | +type RegionInfo struct { | ||
| 102 | + RegionId int `json:"regionId"` | ||
| 103 | + RegionName string `json:"regionName"` | ||
| 104 | +} | ||
| 105 | + | ||
| 106 | +//业务员 | ||
| 107 | +type Salesman struct { | ||
| 108 | + //Id int64 `json:"id"` | ||
| 109 | + Name string `json:"name"` | ||
| 110 | + Telephone string `json:"telephone"` | ||
| 111 | +} |
pkg/domain/region_info.go
已删除
100644 → 0
pkg/domain/salesman.go
已删除
100644 → 0
pkg/infrastructure/pg/models/company.go
0 → 100644
| @@ -39,7 +39,7 @@ func (this *AuthController) SmsCode() { | @@ -39,7 +39,7 @@ func (this *AuthController) SmsCode() { | ||
| 39 | }() | 39 | }() |
| 40 | var request *protocol.SmsCodeRequest | 40 | var request *protocol.SmsCodeRequest |
| 41 | if err := this.JsonUnmarshal(&request); err != nil { | 41 | if err := this.JsonUnmarshal(&request); err != nil { |
| 42 | - msg = protocol.BadRequestParam(1) | 42 | + msg = protocol.BadRequestParam(2) |
| 43 | return | 43 | return |
| 44 | } | 44 | } |
| 45 | if b, m := this.Valid(request); !b { | 45 | if b, m := this.Valid(request); !b { |
| @@ -14,6 +14,11 @@ import ( | @@ -14,6 +14,11 @@ import ( | ||
| 14 | //缓存 | 14 | //缓存 |
| 15 | var CacheSms = cache.NewMemoryCache() | 15 | var CacheSms = cache.NewMemoryCache() |
| 16 | 16 | ||
| 17 | +var ( | ||
| 18 | + clientId = "pdf233Znkjo" | ||
| 19 | + clientSecret = "oHexnmeomYdo19NCmdwne83dfj" | ||
| 20 | +) | ||
| 21 | + | ||
| 17 | type BaseController struct { | 22 | type BaseController struct { |
| 18 | beego.Controller | 23 | beego.Controller |
| 19 | } | 24 | } |
| @@ -6,6 +6,7 @@ import ( | @@ -6,6 +6,7 @@ import ( | ||
| 6 | "github.com/astaxie/beego/context" | 6 | "github.com/astaxie/beego/context" |
| 7 | "github.com/astaxie/beego/logs" | 7 | "github.com/astaxie/beego/logs" |
| 8 | "io/ioutil" | 8 | "io/ioutil" |
| 9 | + "net/http" | ||
| 9 | "time" | 10 | "time" |
| 10 | ) | 11 | ) |
| 11 | 12 | ||
| @@ -35,7 +36,7 @@ func CreateResponseLogFilter(logger *logs.BeeLogger) func(ctx *context.Context) | @@ -35,7 +36,7 @@ func CreateResponseLogFilter(logger *logs.BeeLogger) func(ctx *context.Context) | ||
| 35 | func CreateRequestBodyFilter() func(ctx *context.Context) { | 36 | func CreateRequestBodyFilter() func(ctx *context.Context) { |
| 36 | return func(ctx *context.Context) { | 37 | return func(ctx *context.Context) { |
| 37 | if len(ctx.Input.RequestBody) == 0 { | 38 | if len(ctx.Input.RequestBody) == 0 { |
| 38 | - if ctx.Request.Method == "POST" || ctx.Request.Method == "PUT" { | 39 | + if ctx.Request.Method == http.MethodPost || ctx.Request.Method == http.MethodPut { |
| 39 | body, _ := ioutil.ReadAll(ctx.Request.Body) | 40 | body, _ := ioutil.ReadAll(ctx.Request.Body) |
| 40 | if len(body) == 0 { | 41 | if len(body) == 0 { |
| 41 | body = []byte("{}") | 42 | body = []byte("{}") |
| @@ -12,6 +12,7 @@ var errmessge ErrorMap = map[int]string{ | @@ -12,6 +12,7 @@ var errmessge ErrorMap = map[int]string{ | ||
| 12 | 1011: "获取验证码次数超出限制,请联系管理员", | 12 | 1011: "获取验证码次数超出限制,请联系管理员", |
| 13 | 1012: "请输入正确的验证码", | 13 | 1012: "请输入正确的验证码", |
| 14 | 14 | ||
| 15 | + 2002: "您还不是正式用户,请联系管理员", | ||
| 15 | 2021: "登录失败,手机号或密码错误", | 16 | 2021: "登录失败,手机号或密码错误", |
| 16 | 2025: "短信验证码验证失败", | 17 | 2025: "短信验证码验证失败", |
| 17 | 2026: "新密码与确认密码不一致", | 18 | 2026: "新密码与确认密码不一致", |
-
请 注册 或 登录 后发表评论