This commit is contained in:
jiangyong 2026-03-12 20:43:21 +08:00
parent b456c3da06
commit bfdd9339e6
2 changed files with 11 additions and 3 deletions

View File

@ -316,6 +316,11 @@ func (a *App) Upload(path, kind string) (string, error) {
return cast.ToString(result["media_id"]), nil
}
func (a *App) MediaUrl(mediaId string) string {
mUrl := fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=%s&media_id=%s", a.GetToken(), mediaId)
return mUrl
}
func (q *App) GetJsapiConfig(url string) (*JsapiConfig, error) {
ticket, err := q.getJsapiTicket()
if err != nil {

View File

@ -3,11 +3,12 @@ package qyweixin
import (
"encoding/json"
"fmt"
"strings"
"git.u8t.cn/open/gosdk/util"
"git.u8t.cn/open/goutil"
log "github.com/sirupsen/logrus"
"github.com/spf13/cast"
"strings"
)
type Applyer struct {
@ -165,9 +166,11 @@ func (d *ApproveDetail) GetData() map[string]string {
} else if content.Control == "Money" {
value = content.Value.NewMoney
} else if content.Control == "File" {
if len(content.Value.Files) > 0 {
value = content.Value.Files[0].FileId
fileIds := make([]string, 0)
for _, v := range content.Value.Files {
fileIds = append(fileIds, v.FileId)
}
value = strings.Join(fileIds, ",")
} else if content.Control == "Vacation" { //请假 请假类型,开始时间,结束时间,请假时长
tp := content.Value.Vacation.Selector.Options[0].Value[0].Text
value = tp + "," + cast.ToString(content.Value.Vacation.Attendance.DateRange.NewBegin) +