mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
chore: use config value for order pay timeout
This commit is contained in:
parent
f755bdccae
commit
717b137a6d
@ -83,7 +83,7 @@ func (h *PaymentHandler) DoPay(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检查二维码是否过期
|
// 检查二维码是否过期
|
||||||
if time.Now().Unix()-int64(t) > 30 {
|
if time.Now().Unix()-int64(t) > int64(h.App.SysConfig.OrderPayTimeout) {
|
||||||
resp.ERROR(c, "支付二维码已过期,请重新生成!")
|
resp.ERROR(c, "支付二维码已过期,请重新生成!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -342,6 +342,8 @@ func (h *PaymentHandler) Mobile(c *gin.Context) {
|
|||||||
payWay = PayWayXunHu
|
payWay = PayWayXunHu
|
||||||
notifyURL = h.App.Config.HuPiPayConfig.NotifyURL
|
notifyURL = h.App.Config.HuPiPayConfig.NotifyURL
|
||||||
returnURL = h.App.Config.HuPiPayConfig.ReturnURL
|
returnURL = h.App.Config.HuPiPayConfig.ReturnURL
|
||||||
|
parse, _ := url.Parse(h.App.Config.HuPiPayConfig.ReturnURL)
|
||||||
|
baseURL := fmt.Sprintf("%s://%s", parse.Scheme, parse.Host)
|
||||||
params := payment.HuPiPayReq{
|
params := payment.HuPiPayReq{
|
||||||
Version: "1.1",
|
Version: "1.1",
|
||||||
TradeOrderId: orderNo,
|
TradeOrderId: orderNo,
|
||||||
@ -351,6 +353,7 @@ func (h *PaymentHandler) Mobile(c *gin.Context) {
|
|||||||
ReturnURL: returnURL,
|
ReturnURL: returnURL,
|
||||||
CallbackURL: returnURL,
|
CallbackURL: returnURL,
|
||||||
WapName: "极客学长",
|
WapName: "极客学长",
|
||||||
|
WapUrl: baseURL,
|
||||||
Type: "WAP",
|
Type: "WAP",
|
||||||
}
|
}
|
||||||
r, err := h.huPiPayService.Pay(params)
|
r, err := h.huPiPayService.Pay(params)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"geekai/utils"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
text := "https://nk.img.r9it.com/chatgpt-plus/1712709360012445.png 请简单描述一下这幅图上的内容 "
|
text := "https://nk.img.r9it.com/chatgpt-plus/1712709360012445.png"
|
||||||
imgURL := utils.ExtractImgURL(text)
|
parse, _ := url.Parse(text)
|
||||||
fmt.Println(imgURL)
|
fmt.Println(fmt.Sprintf("%s://%s", parse.Scheme, parse.Host))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user