27 lines
695 B
Go
27 lines
695 B
Go
package front
|
||
|
||
import (
|
||
"PaymentCenter/app/constants/errorcode"
|
||
"PaymentCenter/app/http/controllers"
|
||
"PaymentCenter/app/http/entities/front"
|
||
"PaymentCenter/app/services/thirdpay"
|
||
"PaymentCenter/app/utils"
|
||
"github.com/gin-gonic/gin"
|
||
)
|
||
|
||
// 支付宝小程序获取授权,获取openId
|
||
func GetAliOauth(c *gin.Context) {
|
||
req, _ := controllers.GetRequest(c).(*front.GetAliOauthRequest)
|
||
rsp, err := thirdpay.GetAliOauth(c, *req)
|
||
if err != nil {
|
||
utils.Log(c, "GetAliOauth-获取支付宝授权失败", err.Error())
|
||
c.JSON(200, gin.H{
|
||
"code": errorcode.SystemError,
|
||
"message": err.Error(),
|
||
"data": "",
|
||
})
|
||
return
|
||
}
|
||
controllers.HandCodeRes(c, rsp, errorcode.Success)
|
||
}
|