添加抖音小程序二维码

This commit is contained in:
邹宗楠
2022-06-09 14:13:31 +08:00
parent 5a2e8d7cc1
commit bd9bb69dc3
4 changed files with 22 additions and 13 deletions

View File

@@ -1,29 +1,29 @@
package tiktok
import (
"fmt"
"git.rosy.net.cn/baseapi/utils"
)
// 获取抖音小程序二维码
func (a *API) GetTiktokQrCode() error {
// GetTiktokQrCode 获取抖音小程序二维码
func (a *API) GetTiktokQrCode(storeId string) (map[string]interface{}, error) {
param := &QrCode{
AppName: "douyin",
AccessToken: "",
Path: "pages/index/index",
Path: "pages/index/index?" + storeId,
Width: 0,
LineColor: nil,
Background: nil,
SetIcon: true,
}
a.CheckTokenIsExist()
if err := a.CheckTokenIsExist(); err != nil {
return nil, err
}
param.AccessToken = a.msgToken
qrCode, err := a.AccessAPI2(GetTiktokQrCode, utils.Struct2MapByJson(param))
if err != nil {
return err
return nil, err
}
fmt.Println("qrcode", qrCode)
return err
return qrCode, err
}
//type QrCodeRes struct {