1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/xiaochengtech-alipay

Клонировать/Скачать
open_auth_token_app_url.go 1.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Xiaosong Gao Отправлено 02.11.2020 08:35 91f2143
package alipay
import (
"fmt"
"net/url"
"strings"
)
// 第三方应用授权URL,单个授权
// https://opendocs.alipay.com/open/20160728150111277227/intro
func GetOpenAuthTokenAppUrlSingle(isProd bool, appId string, redirectUri string) (result string) {
if isProd {
result += "https://openauth.alipay.com"
} else {
result += "https://openauth.alipaydev.com"
}
result += "/oauth2/appToAppAuth.htm"
result += fmt.Sprintf("?app_id=%s", appId)
result += fmt.Sprintf("&redirect_uri=%s", url.QueryEscape(redirectUri))
return
}
// 第三方应用授权URL,批量授权
// https://opendocs.alipay.com/open/20160728150111277227/intro
func GetOpenAuthTokenAppUrlBatch(
isProd bool,
appId string,
applicationTypes []string,
redirectUri string,
) (result string) {
if isProd {
result += "https://openauth.alipay.com"
} else {
result += "https://openauth.alipaydev.com"
}
result += "/oauth2/appToAppBatchAuth.htm"
result += fmt.Sprintf("?app_id=%s", appId)
result += fmt.Sprintf("&application_type=%s", strings.Join(applicationTypes, ","))
result += fmt.Sprintf("&redirect_uri=%s", url.QueryEscape(redirectUri))
return
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/xiaochengtech-alipay.git
git@api.gitlife.ru:oschina-mirror/xiaochengtech-alipay.git
oschina-mirror
xiaochengtech-alipay
xiaochengtech-alipay
master