PaymentCenter/app/http/controllers/front/ali.go

27 lines
695 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)
}