This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-12-04 09:40:37 +08:00
parent 973c7c024c
commit 261e445908
11 changed files with 28 additions and 34 deletions

View File

@ -22,8 +22,10 @@ func (s photo) Config(m *ice.Message, arg ...string) {
func (s photo) List(m *ice.Message, arg ...string) {
s.cmdy(m, PhotoVendor.Folder, kit.Slice(arg, 1)...)
m.PushAction(s.Trash).Action(s.Upload).Display("")
if m.Result() == "" {
s.Button(m, "请上传文件", s.Upload)
}
}
func (s photo) Upload(m *ice.Message, arg ...string) { s.cmdy(m, "") }
func (s photo) Trash(m *ice.Message, arg ...string) { s.cmdy(m, "") }

View File

@ -0,0 +1,4 @@
source weixinpayment/weixinpayment.shy
source tencentmeeting/tencentmeeting.shy
source tencentdocument/tencentdocument.shy
source tencentcloud/tencentcloud.shy

View File

@ -16,24 +16,24 @@ type ocr struct {
func (s ocr) List(m *ice.Message, arg ...string) {}
func (s ocr) BizLicense(m *ice.Message, arg ...string) {
request := sdk.NewBizLicenseOCRRequest()
request.ImageBase64 = common.StringPtr(s.ImageData(m, arg...))
response, err := s.newClient(m).BizLicenseOCR(request)
s.ParseResponse(m, response, err)
}
func (s ocr) IDCard(m *ice.Message, arg ...string) {
request := sdk.NewIDCardOCRRequest()
request.ImageBase64 = common.StringPtr(s.ImageData(m, arg...))
response, err := s.newClient(m).IDCardOCR(request)
s.ParseResponse(m, response, err)
}
func (s ocr) BizLicense(m *ice.Message, arg ...string) {
request := sdk.NewBizLicenseOCRRequest()
request.ImageBase64 = common.StringPtr(s.ImageData(m, arg...))
response, err := s.newClient(m).BizLicenseOCR(request)
s.ParseResponse(m, response, err)
}
func init() { ice.TeamCtxCmd(ocr{}) }
func init() { renzhengshouquan.OcrVendor = ocr{} }
func (s ocr) newClient(m *ice.Message, arg ...string) *sdk.Client {
c, _ := sdk.NewClient(s.NewCredential(m), "", s.NewProfile(m))
return c
}
func init() { renzhengshouquan.OcrVendor = ocr{} }

View File

@ -18,7 +18,7 @@ import (
type realname struct {
renzhengshouquan.Table
order string `data:"17"`
order string `data:"18"`
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"`
@ -38,21 +38,11 @@ func (s realname) Check(m *ice.Message, arg ...string) {
secretId := msg.Append("secret_id")
secretKey := msg.Append("secret_key")
// source := "market-2qkoxdj5i"
// secretId := "AKIDfjSG99M0m5gqr0aiyN4Ho0rfut22jybmlrj1"
// secretKey := "3oga413JEe58di8k2NkVim5s79Qmuw17DWVV6spD"
// source := "market-dw3yg5tm8"
// secretId := "AKIDHFZ1EdTz3D7Y4nMYESfSKdv1RTpkbKe7LjpU"
// secretKey := "cpcts0905vj0wm2qw6l8az5dermgvp8m7op4wzgw"
auth, datetime := calcAuthorization(source, secretId, secretKey)
m.Option(web.SPIDE_HEADER, map[string]string{"X-Source": source, "Authorization": auth, "X-Date": datetime})
res := m.Cmdx(web.SPIDE, ice.DEV, web.SPIDE_RAW, http.MethodPost, "https://service-rbgpp2hy-1305308687.gz.apigw.tencentcs.com/release/release/mobile/3-realnameauth",
web.SPIDE_FORM, "mobile_number", arg[0], "idcard_number", arg[1], "name", arg[2])
m.WarnNotRight(kit.Value(kit.UnMarshal(res), "data.result") != "0")
// m.Cmdy(web.SPIDE, ice.DEV, web.SPIDE_RAW, http.MethodPost, "https://service-91ii7z5b-1300755093.ap-beijing.apigateway.myqcloud.com/release/phone3element",
// web.SPIDE_FORM, "mobile", arg[0], "idCard", arg[1], "realName", arg[2])
}
func calcAuthorization(source string, secretId string, secretKey string) (auth string, datetime string) {

View File

@ -25,7 +25,7 @@ import (
type smh struct {
renzhengshouquan.Table
tencentcloud.Tencentcloud
order string `data:"18"`
order string `data:"16"`
fields string `data:"name,info,library_id,library_secret,access_token,expire_time,user_uid"`
libraryCreate string `name:"libraryCreate" role:"leader"`
libraryRemove string `name:"libraryRemove" role:"leader"`

View File

@ -12,9 +12,5 @@
},
"icons": {
"smh": "https://img.icons8.com/officel/80/stack-of-photos.png"
},
"input": {
"secret_id": "SecretID",
"secret_key": "SecretKey"
}
}

View File

@ -1,4 +1,4 @@
chapter "智能媒资"
section "智能媒资托管"
refer `
后台 https://console.cloud.tencent.com/smh/overview
文档 https://cloud.tencent.com/document/product/1339

View File

@ -15,16 +15,15 @@ import (
type sms struct {
renzhengshouquan.Table
tencentcloud.Tencentcloud
order string `data:"16"`
order string `data:"17"`
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 sign_name* template_id* app_id*" role:"leader"`
remove string `name:"remove" role:"leader"`
send string `name:"send mobile verify" role:"leader"`
}
func (s sms) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).Display("")
m.PushAction(s.Send, s.Remove)
kit.If(m.Length() > 0, func() { m.Action() })
}
func (s sms) Send(m *ice.Message, arg ...string) {
@ -36,7 +35,6 @@ 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)
}

View File

@ -4,8 +4,8 @@
"sms": "https://img.icons8.com/officel/80/sms.png"
},
"input": {
"app_id": "AppID",
"sign_name": "SignName",
"template_id": "TemplateID"
"template_id": "TemplateID",
"app_id": "AppID"
}
}

View File

@ -1,4 +1,4 @@
chapter "短信"
section "发送短信"
refer `
后台 https://console.cloud.tencent.com/smsv2
调试 https://console.cloud.tencent.com/api/explorer?Product=sms&Version=2021-01-11&Action=SendSms

View File

@ -2,3 +2,7 @@ chapter "腾讯云"
refer `
后台 https://console.cloud.tencent.com/
`
source smh/smh.shy
source ocr/ocr.shy
source sms/sms.shy
source realname/realname.shy