diff --git a/src/gonganxitong/paymentlist.go b/src/gonganxitong/paymentlist.go index 8b77b31..f3c5cff 100644 --- a/src/gonganxitong/paymentlist.go +++ b/src/gonganxitong/paymentlist.go @@ -2,17 +2,18 @@ package gonganxitong import ( "shylinux.com/x/ice" - "shylinux.com/x/toolkits" + kit "shylinux.com/x/toolkits" "shylinux.com/x/community/src/gonganxitong/model" ) type paymentlist struct { Table - order string `data:"91"` - fields string `data:"user_uid,paymentlist_status,amount,title,content"` - create string `name:"create amount* title* content" role:"leader"` - payfor string `name:"payfor" help:"支付" style:"notice" role:"void"` + order string `data:"91"` + auth_uid string `data:""` + fields string `data:"user_uid,paymentlist_status,amount,title,content"` + create string `name:"create amount* title* content" role:"leader"` + payfor string `name:"payfor" help:"支付" style:"notice" role:"void"` } func (s paymentlist) Create(m *ice.Message, arg ...string) { diff --git a/src/renzhengshouquan/cert.go b/src/renzhengshouquan/cert.go index 2f277c0..139e74b 100644 --- a/src/renzhengshouquan/cert.go +++ b/src/renzhengshouquan/cert.go @@ -5,7 +5,7 @@ import ( "shylinux.com/x/ice" "shylinux.com/x/icebergs/base/mdb" - "shylinux.com/x/toolkits" + kit "shylinux.com/x/toolkits" "shylinux.com/x/community/src/renzhengshouquan/model" ) @@ -53,21 +53,20 @@ func (s cert) List(m *ice.Message, arg ...string) { case CertVerify: m.PushButton(s.Check) default: - m.PushButton(s.Verify) - // m.PushButton() + m.PushButton() } }).Action(s.Upload).Display("").DisplayCSS("") s.Button(m, "", s.Upload) } } func (s cert) Verify(m *ice.Message, arg ...string) { - if m.Option(model.VERIFY) == "000" { + msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID)...) + if msg.Append(model.VERIFY) == "" { verify := kit.Format("%06d", rand.Intn(10000)) - s.Update(m, kit.Dict(model.VERIFY, verify), m.OptionSimple(model.AUTH_UID, model.UID)...) + s.Update(m, kit.Dict(model.MOBILE, m.Option(model.MOBILE), model.VERIFY, verify), m.OptionSimple(model.AUTH_UID)...) m.Cmd(SmsVendor, SmsVendor.Send, m.Option(model.MOBILE), verify) } else { - msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID, model.UID)...) - if msg.Append(model.VERIFY) == m.Option(model.VERIFY) { + if !m.WarnNotValid(m.Option(model.VERIFY) != msg.Append(model.VERIFY)) { s.Check(m) } } diff --git a/src/renzhengshouquan/common.go b/src/renzhengshouquan/common.go index ce35444..754d354 100644 --- a/src/renzhengshouquan/common.go +++ b/src/renzhengshouquan/common.go @@ -5,8 +5,10 @@ import ( "shylinux.com/x/ice" "shylinux.com/x/icebergs/base/aaa" + "shylinux.com/x/icebergs/base/ctx" kit "shylinux.com/x/toolkits" + "shylinux.com/x/community/src/api" "shylinux.com/x/community/src/renzhengshouquan/model" "shylinux.com/x/enterprise/src/guanlixitong" ) @@ -53,7 +55,9 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { } func (s Table) GetAuthUID(m *ice.Message, arg ...string) string { - return "4c6a8ccf186816b332ad9dc5655255dd" + auth_uid := m.Cmdx(ctx.CONFIG, api.RENZHENGSHOUQUAN_PORTAL, kit.Keym(model.AUTH_UID)) + m.Info("default auth_uid %v", auth_uid) + return auth_uid } type Tables struct{ Table } diff --git a/src/renzhengshouquan/external/tencentcloud/realname/realname.go b/src/renzhengshouquan/external/tencentcloud/realname/realname.go index da67df8..82f15e6 100644 --- a/src/renzhengshouquan/external/tencentcloud/realname/realname.go +++ b/src/renzhengshouquan/external/tencentcloud/realname/realname.go @@ -18,7 +18,7 @@ import ( type realname struct { renzhengshouquan.Table - order string `data:"16"` + order string `data:"17"` fields string `data:"auth_uid,user_uid,source_id,secret_id,secret_key"` create string `name:"create source_id* secret_id* secret_key*" role:"leader"` remove string `name:"remove" role:"leader"` @@ -33,7 +33,7 @@ func init() { ice.TeamCtxCmd(realname{}) } func init() { renzhengshouquan.RealnameVendor = realname{} } func (s realname) Check(m *ice.Message, arg ...string) { - msg := s.Select(m.Spawn(), model.AUTH_UID, "4c6a8ccf186816b332ad9dc5655255dd") + msg := s.Select(m.Spawn(), model.AUTH_UID, s.GetAuthUID(m)) source := msg.Append("source_id") secretId := msg.Append("secret_id") secretKey := msg.Append("secret_key") diff --git a/src/renzhengshouquan/external/tencentcloud/sms/sms.go b/src/renzhengshouquan/external/tencentcloud/sms/sms.go index 73f487e..59f07c0 100644 --- a/src/renzhengshouquan/external/tencentcloud/sms/sms.go +++ b/src/renzhengshouquan/external/tencentcloud/sms/sms.go @@ -15,7 +15,7 @@ import ( type sms struct { renzhengshouquan.Table tencentcloud.Tencentcloud - order string `data:"17"` + order string `data:"16"` fields string `data:"auth_uid,user_uid,sign_name AS sign_name,template_id,app_id"` create string `name:"create app_id* sign_name* template_id*" role:"leader"` remove string `name:"remove" role:"leader"` @@ -36,6 +36,7 @@ func (s sms) Send(m *ice.Message, arg ...string) { request.PhoneNumberSet = common.StringPtrs([]string{m.Option(model.MOBILE)}) request.TemplateParamSet = common.StringPtrs([]string{m.Option(model.VERIFY)}) response, err := s.newClient(m).SendSms(request) + m.Info("send sms %v %v %v", kit.Format(request), kit.Format(response), err) s.ParseResponse(m, response, err) } diff --git a/src/renzhengshouquan/external/tencentcloud/tencentcloud.go b/src/renzhengshouquan/external/tencentcloud/tencentcloud.go index 4b9493f..68e2b23 100644 --- a/src/renzhengshouquan/external/tencentcloud/tencentcloud.go +++ b/src/renzhengshouquan/external/tencentcloud/tencentcloud.go @@ -34,7 +34,7 @@ type Tencentcloud struct{ tencentcloud } func init() { ice.TeamCtxCmd(Tencentcloud{}) } func (s Tencentcloud) NewCredential(m *ice.Message, arg ...string) *common.Credential { - msg := m.Cmd(s, "4c6a8ccf186816b332ad9dc5655255dd") + msg := m.Cmd(s, s.GetAuthUID(m)) return common.NewCredential(msg.Append(model.SECRET_ID), msg.Append(model.SECRET_KEY)) } func (s Tencentcloud) NewProfile(m *ice.Message, arg ...string) *profile.ClientProfile { diff --git a/src/renzhengshouquan/external/weixinpayment/weixinpayment.go b/src/renzhengshouquan/external/weixinpayment/weixinpayment.go index 95c0430..1a749dd 100644 --- a/src/renzhengshouquan/external/weixinpayment/weixinpayment.go +++ b/src/renzhengshouquan/external/weixinpayment/weixinpayment.go @@ -37,8 +37,7 @@ func (s weixinpayment) List(m *ice.Message, arg ...string) { kit.If(m.Length() > 0, func() { m.Action() }) } func (s weixinpayment) Request(m *ice.Message, arg ...string) { - m.Option("auth_uid", "308a1ca57c40e2a46f6568e017269cdd") - msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID)...) + msg := s.Select(m.Spawn(), model.AUTH_UID, s.GetAuthUID(m)) svc := jsapi.JsapiApiService{Client: s.newClient(m, msg)} resp, result, err := svc.PrepayWithRequestPayment(m, jsapi.PrepayRequest{ Appid: core.String(msg.Append("app_id")), diff --git a/src/renzhengshouquan/portal.go b/src/renzhengshouquan/portal.go index 4a5261d..9dbb455 100644 --- a/src/renzhengshouquan/portal.go +++ b/src/renzhengshouquan/portal.go @@ -18,7 +18,7 @@ type Portal struct { func (s Portal) List(m *ice.Message, arg ...string) { s.Portal.List(m, arg...) kit.If(len(arg) == 0 && m.Length() > 0, func() { m.PushAction(s.PlaceRemove).Action() }) - m.Sort("auth_status,auth_type,created_at", []string{"2"}, []string{"personal", "root", "city", "street", "school", "company", "service"}, ice.STR_R) + m.Sort("auth_status,auth_type,created_at", []string{"issued"}, []string{"personal", "root", "city", "street", "school", "company", "service"}, ice.STR_R) } func (s Portal) PlaceCreate(m *ice.Message, arg ...string) { switch AuthType(kit.Int(m.Option(model.AUTH_TYPE))) {