This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-11-28 12:31:59 +08:00
parent 8cda9be1b6
commit 5de7c6a3a2
8 changed files with 24 additions and 20 deletions

View File

@ -2,17 +2,18 @@ package gonganxitong
import ( import (
"shylinux.com/x/ice" "shylinux.com/x/ice"
"shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/gonganxitong/model" "shylinux.com/x/community/src/gonganxitong/model"
) )
type paymentlist struct { type paymentlist struct {
Table Table
order string `data:"91"` order string `data:"91"`
fields string `data:"user_uid,paymentlist_status,amount,title,content"` auth_uid string `data:""`
create string `name:"create amount* title* content" role:"leader"` fields string `data:"user_uid,paymentlist_status,amount,title,content"`
payfor string `name:"payfor" help:"支付" style:"notice" role:"void"` 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) { func (s paymentlist) Create(m *ice.Message, arg ...string) {

View File

@ -5,7 +5,7 @@ import (
"shylinux.com/x/ice" "shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/renzhengshouquan/model" "shylinux.com/x/community/src/renzhengshouquan/model"
) )
@ -53,21 +53,20 @@ func (s cert) List(m *ice.Message, arg ...string) {
case CertVerify: case CertVerify:
m.PushButton(s.Check) m.PushButton(s.Check)
default: default:
m.PushButton(s.Verify) m.PushButton()
// m.PushButton()
} }
}).Action(s.Upload).Display("").DisplayCSS("") }).Action(s.Upload).Display("").DisplayCSS("")
s.Button(m, "", s.Upload) s.Button(m, "", s.Upload)
} }
} }
func (s cert) Verify(m *ice.Message, arg ...string) { 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)) 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) m.Cmd(SmsVendor, SmsVendor.Send, m.Option(model.MOBILE), verify)
} else { } else {
msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID, model.UID)...) if !m.WarnNotValid(m.Option(model.VERIFY) != msg.Append(model.VERIFY)) {
if msg.Append(model.VERIFY) == m.Option(model.VERIFY) {
s.Check(m) s.Check(m)
} }
} }

View File

@ -5,8 +5,10 @@ import (
"shylinux.com/x/ice" "shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/ctx"
kit "shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/api"
"shylinux.com/x/community/src/renzhengshouquan/model" "shylinux.com/x/community/src/renzhengshouquan/model"
"shylinux.com/x/enterprise/src/guanlixitong" "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 { 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 } type Tables struct{ Table }

View File

@ -18,7 +18,7 @@ import (
type realname struct { type realname struct {
renzhengshouquan.Table renzhengshouquan.Table
order string `data:"16"` order string `data:"17"`
fields string `data:"auth_uid,user_uid,source_id,secret_id,secret_key"` 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"` create string `name:"create source_id* secret_id* secret_key*" role:"leader"`
remove string `name:"remove" role:"leader"` remove string `name:"remove" role:"leader"`
@ -33,7 +33,7 @@ func init() { ice.TeamCtxCmd(realname{}) }
func init() { renzhengshouquan.RealnameVendor = realname{} } func init() { renzhengshouquan.RealnameVendor = realname{} }
func (s realname) Check(m *ice.Message, arg ...string) { 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") source := msg.Append("source_id")
secretId := msg.Append("secret_id") secretId := msg.Append("secret_id")
secretKey := msg.Append("secret_key") secretKey := msg.Append("secret_key")

View File

@ -15,7 +15,7 @@ import (
type sms struct { type sms struct {
renzhengshouquan.Table renzhengshouquan.Table
tencentcloud.Tencentcloud 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"` 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"` create string `name:"create app_id* sign_name* template_id*" role:"leader"`
remove string `name:"remove" 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.PhoneNumberSet = common.StringPtrs([]string{m.Option(model.MOBILE)})
request.TemplateParamSet = common.StringPtrs([]string{m.Option(model.VERIFY)}) request.TemplateParamSet = common.StringPtrs([]string{m.Option(model.VERIFY)})
response, err := s.newClient(m).SendSms(request) 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) s.ParseResponse(m, response, err)
} }

View File

@ -34,7 +34,7 @@ type Tencentcloud struct{ tencentcloud }
func init() { ice.TeamCtxCmd(Tencentcloud{}) } func init() { ice.TeamCtxCmd(Tencentcloud{}) }
func (s Tencentcloud) NewCredential(m *ice.Message, arg ...string) *common.Credential { 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)) return common.NewCredential(msg.Append(model.SECRET_ID), msg.Append(model.SECRET_KEY))
} }
func (s Tencentcloud) NewProfile(m *ice.Message, arg ...string) *profile.ClientProfile { func (s Tencentcloud) NewProfile(m *ice.Message, arg ...string) *profile.ClientProfile {

View File

@ -37,8 +37,7 @@ func (s weixinpayment) List(m *ice.Message, arg ...string) {
kit.If(m.Length() > 0, func() { m.Action() }) kit.If(m.Length() > 0, func() { m.Action() })
} }
func (s weixinpayment) Request(m *ice.Message, arg ...string) { func (s weixinpayment) Request(m *ice.Message, arg ...string) {
m.Option("auth_uid", "308a1ca57c40e2a46f6568e017269cdd") msg := s.Select(m.Spawn(), model.AUTH_UID, s.GetAuthUID(m))
msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID)...)
svc := jsapi.JsapiApiService{Client: s.newClient(m, msg)} svc := jsapi.JsapiApiService{Client: s.newClient(m, msg)}
resp, result, err := svc.PrepayWithRequestPayment(m, jsapi.PrepayRequest{ resp, result, err := svc.PrepayWithRequestPayment(m, jsapi.PrepayRequest{
Appid: core.String(msg.Append("app_id")), Appid: core.String(msg.Append("app_id")),

View File

@ -18,7 +18,7 @@ type Portal struct {
func (s Portal) List(m *ice.Message, arg ...string) { func (s Portal) List(m *ice.Message, arg ...string) {
s.Portal.List(m, arg...) s.Portal.List(m, arg...)
kit.If(len(arg) == 0 && m.Length() > 0, func() { m.PushAction(s.PlaceRemove).Action() }) 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) { func (s Portal) PlaceCreate(m *ice.Message, arg ...string) {
switch AuthType(kit.Int(m.Option(model.AUTH_TYPE))) { switch AuthType(kit.Int(m.Option(model.AUTH_TYPE))) {